[PATCH] D141994: [IndVars] Expand icmp in preheader rather than in loop

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 01:02:58 PST 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1363
   BranchInst *BI = cast<BranchInst>(ExitingBB->getTerminator());
   Rewriter.setInsertPoint(BI);
   auto *LHSV = Rewriter.expandCodeFor(LIP.LHS);
----------------
Shouldn't the Rewriter expand in the preheader as well? Can LHSV/RHSV ever *not* be loop invariant in this function?


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

https://reviews.llvm.org/D141994



More information about the llvm-commits mailing list