[PATCH] D103340: [LoopUnroll] Use changeToUnreachable()
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 28 15:11:41 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG90310dfff8fd: [LoopUnroll] Use changeToUnreachable() (NFC) (authored by nikic).
Changed prior to commit:
https://reviews.llvm.org/D103340?vs=348580&id=348590#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103340/new/
https://reviews.llvm.org/D103340
Files:
llvm/lib/Transforms/Utils/LoopUnroll.cpp
Index: llvm/lib/Transforms/Utils/LoopUnroll.cpp
===================================================================
--- llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -763,13 +763,6 @@
}
}
- // When completely unrolling, the last latch becomes unreachable.
- if (!LatchIsExiting && CompletelyUnroll) {
- BranchInst *Term = cast<BranchInst>(Latches.back()->getTerminator());
- new UnreachableInst(Term->getContext(), Term);
- Term->eraseFromParent();
- }
-
// Update dominators of blocks we might reach through exits.
// Immediate dominator of such block might change, because we add more
// routes which can lead to the exit: we can now reach it from the copied
@@ -819,6 +812,12 @@
DT->verify(DominatorTree::VerificationLevel::Fast));
DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
+
+ // When completely unrolling, the last latch becomes unreachable.
+ if (!LatchIsExiting && CompletelyUnroll)
+ changeToUnreachable(Latches.back()->getTerminator(), /* UseTrap */ false,
+ PreserveLCSSA, &DTU);
+
// Merge adjacent basic blocks, if possible.
for (BasicBlock *Latch : Latches) {
BranchInst *Term = dyn_cast<BranchInst>(Latch->getTerminator());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103340.348590.patch
Type: text/x-patch
Size: 1286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210528/13fe16dc/attachment.bin>
More information about the llvm-commits
mailing list