[PATCH] Make ScalarEvolution less aggressive with respect to no-wrap flags.

Hans Wennborg hans at chromium.org
Wed Jan 21 10:09:25 PST 2015


On Wed, Jan 21, 2015 at 12:25 AM, Sanjoy Das
<sanjoy at playingwithpointers.com> wrote:
> Hi atrick, majnemer,
>
> ScalarEvolution currently lowers a subtraction recurrence to an add recurrence with the same no-wrap flags as the subtraction.  This is incorrect because `sub nsw X, Y` is not the same as `add nsw X, -Y` and `sub nuw X, Y` is not the same as `add nuw X, -Y`.  This patch fixes the issue, and adds a test case demonstrating the bug.
>
> http://reviews.llvm.org/D7081

Is this fixing a bug that's present on the 3.6 branch and that users
could potentially hit, i.e. should we merge this fix?

Thanks,
Hans




More information about the llvm-commits mailing list