aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnroll.cpp
diff options
context:
space:
mode:
authorSerguei Katkov <serguei.katkov@azul.com>2019-07-15 08:26:45 +0000
committerSerguei Katkov <serguei.katkov@azul.com>2019-07-15 08:26:45 +0000
commit3ed93b4673b98dc58af0d25c4ab33fd2bcf8fca1 (patch)
tree4d1fe18a5bd2d96a5a62326aac7c3fa03fbd5791 /llvm/lib/Transforms/Utils/LoopUnroll.cpp
parent17b4a932fae975f9e33863ef834613654eefe9e4 (diff)
downloadllvm-3ed93b4673b98dc58af0d25c4ab33fd2bcf8fca1.zip
llvm-3ed93b4673b98dc58af0d25c4ab33fd2bcf8fca1.tar.gz
llvm-3ed93b4673b98dc58af0d25c4ab33fd2bcf8fca1.tar.bz2
[Loop Peeling] Enable peeling for loops with multiple exits
This CL enables peeling of the loop with multiple exits where one exit should be from latch and others are basic blocks with call to deopt. The peeling is enabled under the flag which is false by default. Reviewers: reames, mkuper, iajbar, fhahn Reviewed By: reames Subscribers: xbolva00, hiraditya, zzheng, llvm-commits Differential Revision: https://reviews.llvm.org/D63923 llvm-svn: 366048
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index 3212dec..e39ade5 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -402,7 +402,8 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
// counts. If we later unroll the loop, we want these to be updated.
if (Peeled) {
// According to our guards and profitability checks the only
- // meaningful exit should be latch block.
+ // meaningful exit should be latch block. Other exits go to deopt,
+ // so we do not worry about them.
BasicBlock *ExitingBlock = L->getLoopLatch();
assert(ExitingBlock && "Loop without exiting block?");
assert(L->isLoopExiting(ExitingBlock) && "Latch is not exiting?");