diff options
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) |