mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Only recalculate DFS Numbers if invalid. Invalidate DFS numbers on reset. Add unit test to verify recalculation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234933 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -243,6 +243,8 @@ protected:
|
||||
this->Roots.clear();
|
||||
Vertex.clear();
|
||||
RootNode = nullptr;
|
||||
DFSInfoValid = false;
|
||||
SlowQueries = 0;
|
||||
}
|
||||
|
||||
// NewBB is split and now it has one successor. Update dominator tree to
|
||||
@ -663,6 +665,12 @@ public:
|
||||
/// updateDFSNumbers - Assign In and Out numbers to the nodes while walking
|
||||
/// dominator tree in dfs order.
|
||||
void updateDFSNumbers() const {
|
||||
|
||||
if (DFSInfoValid) {
|
||||
SlowQueries = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned DFSNum = 0;
|
||||
|
||||
SmallVector<std::pair<const DomTreeNodeBase<NodeT> *,
|
||||
|
Reference in New Issue
Block a user