|
21 | 21 | #include "llvm/CodeGen/LiveIntervals.h"
|
22 | 22 | #include "llvm/CodeGen/LiveVariables.h"
|
23 | 23 | #include "llvm/CodeGen/MachineBasicBlock.h"
|
24 |
| -#include "llvm/CodeGen/MachineDomTreeUpdater.h" |
25 | 24 | #include "llvm/CodeGen/MachineDominators.h"
|
26 | 25 | #include "llvm/CodeGen/MachineFunction.h"
|
27 | 26 | #include "llvm/CodeGen/MachineFunctionPass.h"
|
@@ -96,8 +95,7 @@ namespace {
|
96 | 95 | /// Split critical edges where necessary for good coalescer performance.
|
97 | 96 | bool SplitPHIEdges(MachineFunction &MF, MachineBasicBlock &MBB,
|
98 | 97 | MachineLoopInfo *MLI,
|
99 |
| - std::vector<SparseBitVector<>> *LiveInSets, |
100 |
| - MachineDomTreeUpdater *MDTU); |
| 98 | + std::vector<SparseBitVector<>> *LiveInSets); |
101 | 99 |
|
102 | 100 | // These functions are temporary abstractions around LiveVariables and
|
103 | 101 | // LiveIntervals, so they can go away when LiveVariables does.
|
@@ -185,13 +183,8 @@ bool PHIElimination::runOnMachineFunction(MachineFunction &MF) {
|
185 | 183 | }
|
186 | 184 |
|
187 | 185 | MachineLoopInfo *MLI = getAnalysisIfAvailable<MachineLoopInfo>();
|
188 |
| - auto *DTWrapper = getAnalysisIfAvailable<MachineDominatorTreeWrapperPass>(); |
189 |
| - MachineDominatorTree *MDT = DTWrapper ? &DTWrapper->getDomTree() : nullptr; |
190 |
| - MachineDomTreeUpdater MDTU(MDT, |
191 |
| - MachineDomTreeUpdater::UpdateStrategy::Lazy); |
192 | 186 | for (auto &MBB : MF)
|
193 |
| - Changed |= SplitPHIEdges(MF, MBB, MLI, (LV ? &LiveInSets : nullptr), |
194 |
| - DTWrapper ? &MDTU : nullptr); |
| 187 | + Changed |= SplitPHIEdges(MF, MBB, MLI, (LV ? &LiveInSets : nullptr)); |
195 | 188 | }
|
196 | 189 |
|
197 | 190 | // This pass takes the function out of SSA form.
|
@@ -677,8 +670,7 @@ void PHIElimination::analyzePHINodes(const MachineFunction& MF) {
|
677 | 670 |
|
678 | 671 | bool PHIElimination::SplitPHIEdges(MachineFunction &MF, MachineBasicBlock &MBB,
|
679 | 672 | MachineLoopInfo *MLI,
|
680 |
| - std::vector<SparseBitVector<>> *LiveInSets, |
681 |
| - MachineDomTreeUpdater *MDTU) { |
| 673 | + std::vector<SparseBitVector<>> *LiveInSets) { |
682 | 674 | if (MBB.empty() || !MBB.front().isPHI() || MBB.isEHPad())
|
683 | 675 | return false; // Quick exit for basic blocks without PHIs.
|
684 | 676 |
|
@@ -745,12 +737,7 @@ bool PHIElimination::SplitPHIEdges(MachineFunction &MF, MachineBasicBlock &MBB,
|
745 | 737 | }
|
746 | 738 | if (!ShouldSplit && !SplitAllCriticalEdges)
|
747 | 739 | continue;
|
748 |
| - if (auto *NewMBB = PreMBB->SplitCriticalEdge(&MBB, *this, LiveInSets)) { |
749 |
| - if (MDTU) |
750 |
| - MDTU->applyUpdates({{MachineDominatorTree::Insert, PreMBB, NewMBB}, |
751 |
| - {MachineDominatorTree::Insert, NewMBB, &MBB}, |
752 |
| - {MachineDominatorTree::Delete, PreMBB, &MBB}}); |
753 |
| - } else { |
| 740 | + if (!PreMBB->SplitCriticalEdge(&MBB, *this, LiveInSets)) { |
754 | 741 | LLVM_DEBUG(dbgs() << "Failed to split critical edge.\n");
|
755 | 742 | continue;
|
756 | 743 | }
|
|
0 commit comments