[llvm] [DomTree] Provide a way to query if DFSInfo is valid (PR #91251)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 11:35:30 PDT 2024
https://github.com/hiraditya created https://github.com/llvm/llvm-project/pull/91251
Pass like GVNSink modify CFG use DFS numbers for storing basic blocks (See #90995).
Instead of updating DFS numbers after every modification to CFG,
it is more efficient to do lazily i.e., only when DFS numbers are going to be used by the pass.
>From 3433a51f0a075eb7de5feb13af7b8e2e55f56ad0 Mon Sep 17 00:00:00 2001
From: AdityaK <hiraditya at msn.com>
Date: Mon, 6 May 2024 11:33:49 -0700
Subject: [PATCH] [DomTree] Provide a way to query if DFSInfo is valid
Pass like GVNSink modify CFG use DFS numbers for storing basic blocks.
Instead of updating DFS numbers after every modification to CFG,
it is more efficient to do lazily i.e., only when DFS numbers are
going to be used by the pass.
---
llvm/include/llvm/Support/GenericDomTree.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/include/llvm/Support/GenericDomTree.h b/llvm/include/llvm/Support/GenericDomTree.h
index 4fce9d8bfb2b68..91dd58f1b60873 100644
--- a/llvm/include/llvm/Support/GenericDomTree.h
+++ b/llvm/include/llvm/Support/GenericDomTree.h
@@ -328,6 +328,8 @@ class DominatorTreeBase {
///
bool isPostDominator() const { return IsPostDominator; }
+ bool isDFSInfoValid() const { return DFSInfoValid; }
+
/// compare - Return false if the other dominator tree base matches this
/// dominator tree base. Otherwise return true.
bool compare(const DominatorTreeBase &Other) const {
More information about the llvm-commits
mailing list