[llvm] r328615 - [LoopUnroll][NFC] Remove redundant canPeel check
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 27 02:40:51 PDT 2018
Author: mkazantsev
Date: Tue Mar 27 02:40:51 2018
New Revision: 328615
URL: http://llvm.org/viewvc/llvm-project?rev=328615&view=rev
Log:
[LoopUnroll][NFC] Remove redundant canPeel check
We check `canPeel` twice: when evaluating the number of iterations to be peeled
and within the method `peelLoop` that performs peeling. This method is only
executed if the calculated peel count is positive. Thus, the check in `peelLoop` can
never fail. This patch replaces this check with an assert.
Differential Revision: https://reviews.llvm.org/D44919
Reviewed By: fhahn
Modified:
llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp?rev=328615&r1=328614&r2=328615&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp Tue Mar 27 02:40:51 2018
@@ -473,8 +473,8 @@ static void cloneLoopBlocks(Loop *L, uns
bool llvm::peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI,
ScalarEvolution *SE, DominatorTree *DT,
AssumptionCache *AC, bool PreserveLCSSA) {
- if (!canPeel(L))
- return false;
+ assert(PeelCount > 0 && "Attempt to peel out zero iterations?");
+ assert(canPeel(L) && "Attempt to peel a loop which is not peelable?");
LoopBlocksDFS LoopBlocks(L);
LoopBlocks.perform(LI);
More information about the llvm-commits
mailing list