[PATCH] D38415: [SimplifyIndVar] Replace IVUsers with loop invariant if possible

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 15:05:35 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:557
+  Loop *UserL = LI->getLoopFor(I->getParent());
+  S = SE->getSCEVAtScope(S, UserL);
 
----------------
`SE->getSCEVAtScope(SE->getSCEV(I), LI->getLoopFor(I->getParent()))` should be equivalent to `SE->getSCEV(I)`.  The point of getSCEVAtScope is to compute the value of a SCEV outside of its associated loop (the exit value).

Sorry, I should have spotted this earlier.


Repository:
  rL LLVM

https://reviews.llvm.org/D38415





More information about the llvm-commits mailing list