Change checkRippleForAdd from a heuristic to a full check -
if it is provable that the add does not overflow return true, otherwise false.
Details
Diff Detail
Event Timeline
lib/Transforms/InstCombine/InstCombineAddSub.cpp | ||
---|---|---|
866 | Space between 'if' and 'parenthese' | |
871 | Wrap both MaxLHS and MaxRHS in std::move so we can reuse one of their allocations to hold the addition result when dealing with larger than 64-bit numbers. | |
880 | Space between 'if' and 'parenthese' | |
885 | Wrap both MinLHS and MinRHS in std::move so we can reuse one of their allocations to hold the addition result when dealing with larger than 64-bit numbers. |
Thanks for the comments, fixed.
I opted for std::move and not += because both don't allocate,
and std::move looks more readable (dedicated name 'Result').
Let me know what you think.
The these parameter names are swapped relative to the caller. Prefer LHS followed by RHS.