[PATCH] D77523: Add CanonicalizeFreezeInLoops pass

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 14:10:49 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CanonicalizeFreezeInLoops.cpp:99
+      } else if ((SteppingInst = dyn_cast<BinaryOperator>(FI->getOperand(0)))) {
+        auto IsAuxiliaryIndVar = [&](unsigned OpIdx, PHINode *&PN) -> bool {
+          PHINode *I = dyn_cast<PHINode>(SteppingInst->getOperand(0));
----------------
OpIdx is unused?


================
Comment at: llvm/lib/Transforms/Utils/CanonicalizeFreezeInLoops.cpp:125
+        if (L->contains(StepBB)) {
+          // Step instruction is in the body. Freezing this can possibly block
+          // SCEV.
----------------
It looks like isAuxiliaryInductionVariable checks that the step is loop-invariant?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77523





More information about the llvm-commits mailing list