[llvm] d6b05fc - Full fix for "AMDGPU/SIInsertSkips: Fix the determination of whether early-exit-after-kill is possible" (hopefully)
Nicolai Hähnle via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 26 07:22:04 PST 2020
Author: Nicolai Hähnle
Date: 2020-02-26T16:21:44+01:00
New Revision: d6b05fccb709eb38b5b4b21901cb63825faee83e
URL: https://github.com/llvm/llvm-project/commit/d6b05fccb709eb38b5b4b21901cb63825faee83e
DIFF: https://github.com/llvm/llvm-project/commit/d6b05fccb709eb38b5b4b21901cb63825faee83e.diff
LOG: Full fix for "AMDGPU/SIInsertSkips: Fix the determination of whether early-exit-after-kill is possible" (hopefully)
Properly preserve the MachineDominatorTree in all cases.
Change-Id: I54cf0c0a20934168a356920ba8ed5097a93c4131
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp b/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
index 9101375f9396..557da1e1cd3b 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
@@ -83,6 +83,7 @@ class SIInsertSkips : public MachineFunctionPass {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<MachineDominatorTree>();
+ AU.addPreserved<MachineDominatorTree>();
MachineFunctionPass::getAnalysisUsage(AU);
}
};
@@ -528,6 +529,8 @@ bool SIInsertSkips::runOnMachineFunction(MachineFunction &MF) {
BuildMI(MBB, &MI, MI.getDebugLoc(), TII->get(AMDGPU::S_BRANCH))
.addMBB(EmptyMBBAtEnd);
MI.eraseFromParent();
+
+ MDT->getBase().insertEdge(&MBB, EmptyMBBAtEnd);
}
break;
More information about the llvm-commits
mailing list