diff options
author | Anna Thomas <anna@azul.com> | 2017-07-06 18:39:26 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2017-07-06 18:39:26 +0000 |
commit | eb6d5d19508c5485aafb7f9a30dee819a3b64352 (patch) | |
tree | 2ccf4707d6ff4c66f1933a4ce8522d6e00f26667 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | |
parent | 47c8f66997b6839e5fd59e4c4b73cebeba325f90 (diff) | |
download | bcm5719-llvm-eb6d5d19508c5485aafb7f9a30dee819a3b64352.tar.gz bcm5719-llvm-eb6d5d19508c5485aafb7f9a30dee819a3b64352.zip |
[LoopUnrollRuntime] Bailout when multiple exiting blocks to the unique latch exit block
Currently, we do not support multiple exiting blocks to the
latch exit block. However, this bailout wasn't triggered when we had a
unique exit block (which is the latch exit), with multiple exiting
blocks to that unique exit.
Moved the bailout so that it's triggered in both cases and added
testcase.
llvm-svn: 307291
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp index 9ad2b707e6b..f96c0bd149a 100644 --- a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp @@ -504,10 +504,6 @@ bool llvm::UnrollRuntimeLoopRemainder(Loop *L, unsigned Count, // transformed. if (!PreserveLCSSA) return false; - // TODO: Support multiple exiting blocks jumping to the `LatchExit`. This - // will need updating the logic in connectEpilog. - if (!LatchExit->getSinglePredecessor()) - return false; SmallVector<BasicBlock *, 4> Exits; L->getUniqueExitBlocks(Exits); for (auto *BB : Exits) @@ -517,6 +513,11 @@ bool llvm::UnrollRuntimeLoopRemainder(Loop *L, unsigned Count, assert(LatchExit && "Latch Exit should exist!"); + // TODO: Support multiple exiting blocks jumping to the `LatchExit` when + // UnrollRuntimeMultiExit is true. This will need updating the logic in + // connectEpilog. + if (!LatchExit->getSinglePredecessor()) + return false; // Use Scalar Evolution to compute the trip count. This allows more loops to // be unrolled than relying on induction var simplification. if (!SE) |