[llvm] [Support] Store dominator tree nodes in a vector (PR #101705)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 4 06:07:08 PDT 2024
================
@@ -333,35 +336,71 @@ class DominatorTreeBase {
if (!std::is_permutation(Roots.begin(), Roots.end(), Other.Roots.begin()))
return true;
- const DomTreeNodeMapType &OtherDomTreeNodes = Other.DomTreeNodes;
- if (DomTreeNodes.size() != OtherDomTreeNodes.size())
- return true;
-
- for (const auto &DomTreeNode : DomTreeNodes) {
- NodeT *BB = DomTreeNode.first;
- typename DomTreeNodeMapType::const_iterator OI =
- OtherDomTreeNodes.find(BB);
- if (OI == OtherDomTreeNodes.end())
+ size_t NumNodes = 0;
+ // All node we have must exist and be equal in the other tree
----------------
nikic wrote:
```suggestion
// All nodes we have must exist and be equal in the other tree.
```
https://github.com/llvm/llvm-project/pull/101705
More information about the llvm-commits
mailing list