[llvm] 4e74541 - [LoopUnroll] Fix not-rotated.ll by adding back a limitation was unintentionally
Whitney Tsang via llvm-commits
llvm-commits at lists.llvm.org
Thu May 28 20:06:11 PDT 2020
Author: Whitney Tsang
Date: 2020-05-29T03:05:58Z
New Revision: 4e74541a928090b3604094e239884b0ea0a631bb
URL: https://github.com/llvm/llvm-project/commit/4e74541a928090b3604094e239884b0ea0a631bb
DIFF: https://github.com/llvm/llvm-project/commit/4e74541a928090b3604094e239884b0ea0a631bb.diff
LOG: [LoopUnroll] Fix not-rotated.ll by adding back a limitation was unintentionally
removed in https://reviews.llvm.org/D80477
Added:
Modified:
llvm/lib/Transforms/Utils/LoopUnroll.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index 4525681855ce..06e9f7ff2f53 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -326,6 +326,11 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
"branch in latch or a single exiting block.\n");
return LoopUnrollResult::Unmodified;
}
+ if (LatchBI->isConditional() && LatchBI != ExitingBI) {
+ LLVM_DEBUG(
+ dbgs() << "Can't unroll; a conditional latch must exit the loop");
+ return LoopUnrollResult::Unmodified;
+ }
LLVM_DEBUG(dbgs() << " Exiting Block = " << ExitingBI->getParent()->getName()
<< "\n");
More information about the llvm-commits
mailing list