[PATCH] D14175: [SCEV] Generalize the SCEV algorithm for creating expressions for PHI nodes
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 29 11:41:32 PDT 2015
sanjoy requested changes to this revision.
sanjoy added a comment.
This revision now requires changes to proceed.
Overall, looks good. I just have one comment inline.
================
Comment at: lib/Analysis/ScalarEvolution.cpp:3818
@@ +3817,3 @@
+ // by one iteration.
+ const SCEV *Shifted = SCEVShiftRewriter::rewrite(BEValue, L, *this);
+ const SCEV *Start = SCEVInitRewriter::rewrite(Shifted, L, *this);
----------------
Why not do `{A,+,B}` => `(A-B)` as a single transform?
Also, a nice way to document this rule is (totally up to you if you like this language):
```
PHI(f(I), f({I+S,+,S})) --> f({I,+,S})
```
http://reviews.llvm.org/D14175
More information about the llvm-commits
mailing list