[llvm] [SCEVExpander] Relax hoisting condition for AddRec start (PR #75916)
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 19 15:42:22 PST 2023
================
@@ -980,11 +980,14 @@ SCEVExpander::getAddRecExprPHILiterally(const SCEVAddRecExpr *Normalized,
PostIncLoopSet SavedPostIncLoops = PostIncLoops;
PostIncLoops.clear();
- // Expand code for the start value into the loop preheader.
- assert(L->getLoopPreheader() &&
- "Can't expand add recurrences without a loop preheader!");
- Value *StartV =
- expand(Normalized->getStart(), L->getLoopPreheader()->getTerminator());
+ // Expand code for the start value into the loop predecessor. The loop is not
+ // necessarily in Loop Simplify Form, so assert it's legal to do so.
+ auto *LP = L->getLoopPredecessor();
----------------
sanjoy wrote:
Sounds good.
https://github.com/llvm/llvm-project/pull/75916
More information about the llvm-commits
mailing list