diff options
| author | Max Kazantsev <max.kazantsev@azul.com> | 2018-03-27 09:40:51 +0000 |
|---|---|---|
| committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-03-27 09:40:51 +0000 |
| commit | b1ad66ff12991ac4ef464de2540199f784cbcffd (patch) | |
| tree | c7b705cca950fc27a0a93c38c1dd027a01dce613 /llvm/lib/Transforms | |
| parent | 90b7f4f72c3d7725cf8d782e271df1f0329c24d6 (diff) | |
| download | bcm5719-llvm-b1ad66ff12991ac4ef464de2540199f784cbcffd.tar.gz bcm5719-llvm-b1ad66ff12991ac4ef464de2540199f784cbcffd.zip | |
[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
llvm-svn: 328615
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp index d4d78bf8fdf..5f465f328b0 100644 --- a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp @@ -473,8 +473,8 @@ static void cloneLoopBlocks(Loop *L, unsigned IterNumber, BasicBlock *InsertTop, 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); |

