[PATCH] D20058: [SCEV] No-wrap flags are not propagated when folding "{S, +, X}+T ==> {S+T, +, X}"

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sun May 8 23:36:42 PDT 2016


sanjoy requested changes to this revision.
sanjoy added a comment.
This revision now requires changes to proceed.

This needs at least one test case (preferably more than one) demonstrating the motivation.  A simplified form of the "Minimal reproducer:" will do.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:2283
@@ -2282,3 +2282,3 @@
                                              AddRec->op_end());
-      AddRecOps[0] = getAddExpr(LIOps);
+      AddRecOps[0] = getAddExpr(LIOps, Flags);
 
----------------
Can you please add a comment here on why this is correct:

```
// This follows from the fact that the no-wrap flags on the outer add
// expression is applicable on the 0th iteration, when the add recurrence
// will be equal to its start value.
```



Repository:
  rL LLVM

http://reviews.llvm.org/D20058





More information about the llvm-commits mailing list