[PATCH] D62939: Fix a bug w/inbounds invalidation in LFTR (was: Strengthen LFTR's ability to replace IVs)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 10:05:13 PDT 2019


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:2405
+      Instruction *Inc =
+        cast<Instruction>(IndVar->getIncomingValueForBlock(L->getLoopLatch()));
+      ICmpInst *LoopTest = getLoopTest(L, ExitingBB);
----------------
We could move `IncVar` declared below to the top of the function, use it here and also change the `CmpIndVar` assignment below to `CmpIndVar = IncVar`. As is, we're accessing this value three times in this function...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62939/new/

https://reviews.llvm.org/D62939





More information about the llvm-commits mailing list