@@ -67,35 +67,31 @@ MachineDominatorTreeWrapperPass::MachineDominatorTreeWrapperPass()
67
67
*PassRegistry::getPassRegistry ());
68
68
}
69
69
70
- char &llvm::MachineDominatorsID = MachineDominatorTreeWrapperPass::ID;
71
-
72
- bool MachineDominatorTreeWrapperPass::runOnMachineFunction (MachineFunction &F) {
73
- IsDomTreeEmpty = false ;
74
- DT.calculate (F);
75
- return false ;
76
- }
77
-
78
70
void MachineDominatorTree::calculate (MachineFunction &F) {
79
71
CriticalEdgesToSplit.clear ();
80
72
NewBBs.clear ();
81
73
recalculate (F);
82
74
}
83
75
84
- void MachineDominatorTreeWrapperPass::releaseMemory () {
85
- DT.CriticalEdgesToSplit .clear ();
86
- DT.reset ();
87
- IsDomTreeEmpty = true ;
76
+ char &llvm::MachineDominatorsID = MachineDominatorTreeWrapperPass::ID;
77
+
78
+ bool MachineDominatorTreeWrapperPass::runOnMachineFunction (MachineFunction &F) {
79
+ DT = MachineDominatorTree (F);
80
+ return false ;
88
81
}
89
82
83
+ void MachineDominatorTreeWrapperPass::releaseMemory () { DT.reset (); }
84
+
90
85
void MachineDominatorTreeWrapperPass::verifyAnalysis () const {
91
- if (VerifyMachineDomInfo && !IsDomTreeEmpty )
92
- if (!DT. verify (MachineDominatorTree::VerificationLevel::Basic))
86
+ if (VerifyMachineDomInfo && DT )
87
+ if (!DT-> verify (MachineDominatorTree::VerificationLevel::Basic))
93
88
report_fatal_error (" MachineDominatorTree verification failed!" );
94
89
}
95
90
96
91
void MachineDominatorTreeWrapperPass::print (raw_ostream &OS,
97
92
const Module *) const {
98
- DT.print (OS);
93
+ if (DT)
94
+ DT->print (OS);
99
95
}
100
96
101
97
void MachineDominatorTree::applySplitCriticalEdges () const {
@@ -148,7 +144,6 @@ void MachineDominatorTree::applySplitCriticalEdges() const {
148
144
149
145
// Now, update DT with the collected dominance properties info.
150
146
Idx = 0 ;
151
- dbgs () << " critical Edge to split: " << CriticalEdgesToSplit.size ();
152
147
for (CriticalEdge &Edge : CriticalEdgesToSplit) {
153
148
// We know FromBB dominates NewBB.
154
149
MachineDomTreeNode *NewDTNode =
0 commit comments