We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 721fdf1 commit 3250305Copy full SHA for 3250305
llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
@@ -58,13 +58,13 @@ bool UnrolledInstAnalyzer::simplifyInstWithSCEV(Instruction *I) {
58
auto *Base = dyn_cast<SCEVUnknown>(SE.getPointerBase(S));
59
if (!Base)
60
return false;
61
- auto *Offset =
62
- dyn_cast<SCEVConstant>(SE.getMinusSCEV(ValueAtIteration, Base));
+ std::optional<APInt> Offset =
+ SE.computeConstantDifference(ValueAtIteration, Base);
63
if (!Offset)
64
65
SimplifiedAddress Address;
66
Address.Base = Base->getValue();
67
- Address.Offset = Offset->getAPInt();
+ Address.Offset = *Offset;
68
SimplifiedAddresses[I] = Address;
69
70
}
0 commit comments