You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By simple code inspection we can observe that the addition in count += 1 cannot possibly overflow: the maximum possible value of count is elements.count, and that is stored in an Int, so we cannot possibly exceed that value.
It seems as though it might be useful to have an optimisation pass to observe these kinds of changes. The branches for overflow detection don't really incur a cost in performance in-and-of-themselves, but they either cause increased code size (when using -Osize) or inhibit vectorisation (when using -O).
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 476598b20bd5b80905c31e6907cb796c
Issue Description:
Consider the following code:
By simple code inspection we can observe that the addition in
count += 1
cannot possibly overflow: the maximum possible value ofcount
iselements.count
, and that is stored in anInt
, so we cannot possibly exceed that value.It seems as though it might be useful to have an optimisation pass to observe these kinds of changes. The branches for overflow detection don't really incur a cost in performance in-and-of-themselves, but they either cause increased code size (when using
-Osize
) or inhibit vectorisation (when using-O
).The text was updated successfully, but these errors were encountered: