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 72b71ca commit 4b53050Copy full SHA for 4b53050
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -1240,6 +1240,10 @@ Value *SCEVExpander::tryToReuseLCSSAPhi(const SCEVAddRecExpr *S) {
1240
ExitSCEV = SE.getPtrToIntExpr(ExitSCEV, STy);
1241
else if (S->getType() != PN.getType())
1242
continue;
1243
+
1244
+ // Check if we can re-use the existing PN, by adjusting it with an expanded
1245
+ // offset, if the offset is simpler (for now just checks if it is
1246
+ // AddRec-free).
1247
const SCEV *Diff = SE.getMinusSCEV(S, ExitSCEV);
1248
if (isa<SCEVCouldNotCompute>(Diff) ||
1249
SCEVExprContains(Diff,
0 commit comments