[llvm] [ConstraintElim] Support arbitrary incoming values for inductions (PR #68032)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 2 14:18:27 PDT 2023
================
@@ -868,9 +869,10 @@ void State::addInfoForInductions(BasicBlock &BB) {
StartValue = C->getValue();
else if (auto *U = dyn_cast<SCEVUnknown>(StartSCEV))
StartValue = U->getValue();
-
- if (!StartValue)
- return;
+ else {
+ StartValue = PN->getIncomingValueForBlock(LoopPred);
+ assert(SE.getSCEV(StartValue) == AR->getStart() && "inconsistent start value);
----------------
nikic wrote:
```suggestion
assert(SE.getSCEV(StartValue) == StartSCEV && "inconsistent start value);
```
https://github.com/llvm/llvm-project/pull/68032
More information about the llvm-commits
mailing list