forked from OSchip/llvm-project
[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
This commit is contained in:
parent
90b7f4f72c
commit
b1ad66ff12
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue