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

Hongbin Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 16:02:10 PDT 2017


etherzhhb added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:557
+  Loop *UserL = LI->getLoopFor(I->getParent());
+  S = SE->getSCEVAtScope(S, UserL);
 
----------------
efriedma wrote:
> `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.
Thanks for pointing this out, I will update the patch


Repository:
  rL LLVM

https://reviews.llvm.org/D38415





More information about the llvm-commits mailing list