diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopPeel.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopPeel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp index f343962..27e70c5 100644 --- a/llvm/lib/Transforms/Utils/LoopPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp @@ -545,8 +545,11 @@ countToEliminateCompares(Loop &L, unsigned MaxPeelCount, ScalarEvolution &SE, const SCEV *IterVal = AddRec->evaluateAtIteration( SE.getConstant(AddRec->getType(), NewPeelCount), SE); if (!PeelWhilePredicateIsKnown(NewPeelCount, IterVal, BoundSCEV, Step, - Pred)) + Pred)) { + if (shouldPeelLastIteration(L, Pred, AddRec, BoundSCEV, SE, TTI)) + DesiredPeelCountLast = 1; return; + } DesiredPeelCount = NewPeelCount; }; |