1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[NFCI][LoopDeletion] Do not call complex analysis for known non-zero BTC

This commit is contained in:
Max Kazantsev 2021-05-27 15:18:30 +07:00
parent 8529f1644f
commit fb6b06d635

View File

@ -343,6 +343,8 @@ breakBackedgeIfNotTaken(Loop *L, DominatorTree &DT, ScalarEvolution &SE,
return LoopDeletionResult::Unmodified;
auto *BTC = SE.getBackedgeTakenCount(L);
if (!isa<SCEVCouldNotCompute>(BTC) && SE.isKnownNonZero(BTC))
return LoopDeletionResult::Unmodified;
if (!BTC->isZero() && !canProveExitOnFirstIteration(L, DT, SE, LI))
return LoopDeletionResult::Unmodified;