Skip to content

Commit 05187b2

Browse files
author
Aleksander Popov
committed
[SCEV] Add PHI SCEV verification to ensure availability at loop entry
1 parent 0d2722c commit 05187b2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14482,6 +14482,16 @@ void ScalarEvolution::verify() const {
1448214482
<< "Delta: " << *Delta << "\n";
1448314483
std::abort();
1448414484
}
14485+
14486+
if (isa<PHINode>(I))
14487+
for (const Loop *L : ValidLoops)
14488+
if (SE.isAvailableAtLoopEntry(KV.second, L) !=
14489+
SE2.isAvailableAtLoopEntry(NewSCEV, L)) {
14490+
dbgs() << "Incorrect SCEV availability at loop entry\n"
14491+
<< "Old: " << *OldSCEV << "\n"
14492+
<< "New: " << *NewSCEV << "\n";
14493+
std::abort();
14494+
}
1448514495
}
1448614496
}
1448714497

0 commit comments

Comments
 (0)