diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopPeel.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopPeel.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp index 9a24c1b..0f3a92b 100644 --- a/llvm/lib/Transforms/Utils/LoopPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp @@ -640,20 +640,18 @@ void llvm::computePeelCount(Loop *L, unsigned LoopSize, LLVM_DEBUG(dbgs() << "Profile-based estimated trip count is " << *EstimatedTripCount << "\n"); - if (*EstimatedTripCount) { - if (*EstimatedTripCount + AlreadyPeeled <= MaxPeelCount) { - unsigned PeelCount = *EstimatedTripCount; - LLVM_DEBUG(dbgs() << "Peeling first " << PeelCount << " iterations.\n"); - PP.PeelCount = PeelCount; - return; - } - LLVM_DEBUG(dbgs() << "Already peel count: " << AlreadyPeeled << "\n"); - LLVM_DEBUG(dbgs() << "Max peel count: " << UnrollPeelMaxCount << "\n"); - LLVM_DEBUG(dbgs() << "Loop cost: " << LoopSize << "\n"); - LLVM_DEBUG(dbgs() << "Max peel cost: " << Threshold << "\n"); - LLVM_DEBUG(dbgs() << "Max peel count by cost: " - << (Threshold / LoopSize - 1) << "\n"); + if (*EstimatedTripCount + AlreadyPeeled <= MaxPeelCount) { + unsigned PeelCount = *EstimatedTripCount; + LLVM_DEBUG(dbgs() << "Peeling first " << PeelCount << " iterations.\n"); + PP.PeelCount = PeelCount; + return; } + LLVM_DEBUG(dbgs() << "Already peel count: " << AlreadyPeeled << "\n"); + LLVM_DEBUG(dbgs() << "Max peel count: " << UnrollPeelMaxCount << "\n"); + LLVM_DEBUG(dbgs() << "Loop cost: " << LoopSize << "\n"); + LLVM_DEBUG(dbgs() << "Max peel cost: " << Threshold << "\n"); + LLVM_DEBUG(dbgs() << "Max peel count by cost: " + << (Threshold / LoopSize - 1) << "\n"); } } |