Skip to content

Conversation

@eas
Copy link
Contributor

@eas eas commented Jan 29, 2026

No description provided.

@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Jan 29, 2026
@eas
Copy link
Contributor Author

eas commented Jan 29, 2026

Can't add reviewers, tagging @fhahn .

@llvmbot
Copy link
Member

llvmbot commented Jan 29, 2026

@llvm/pr-subscribers-llvm-analysis

Author: Andrei Elovikov (eas)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/178708.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Analysis/DominanceFrontier.h (+1-1)
  • (modified) llvm/include/llvm/Analysis/DominanceFrontierImpl.h (+2-7)
diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h
index 787793501f98a..ec49b36d64cfd 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontier.h
@@ -116,7 +116,7 @@ class ForwardDominanceFrontierBase
     calculate(DT, DT[this->Roots[0]]);
   }
 
-  const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node);
+  void calculate(const DomTreeT &DT, const DomTreeNodeT *Node);
 };
 
 class DominanceFrontier : public ForwardDominanceFrontierBase<BasicBlock> {
diff --git a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
index 1483588581f4e..c7fc463fd3af5 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
@@ -74,11 +74,9 @@ void DominanceFrontierBase<BlockT, IsPostDom>::dump() const {
 #endif
 
 template <class BlockT>
-const typename ForwardDominanceFrontierBase<BlockT>::DomSetType &
-ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
-                                                const DomTreeNodeT *Node) {
+void ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
+                                                     const DomTreeNodeT *Node) {
   BlockT *BB = Node->getBlock();
-  DomSetType *Result = nullptr;
 
   std::vector<DFCalculateWorkObject<BlockT>> workList;
   SmallPtrSet<BlockT *, 32> visited;
@@ -126,7 +124,6 @@ ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
     // from the workList.
     if (!visitChild) {
       if (!parentBB) {
-        Result = &S;
         break;
       }
 
@@ -140,8 +137,6 @@ ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
     }
 
   } while (!workList.empty());
-
-  return *Result;
 }
 
 } // end namespace llvm

calculate(DT, DT[this->Roots[0]]);
}

const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get rid of the using for DomSetType here too.

Copy link
Contributor Author

@eas eas Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still used inside the definition of calculate, so we need this using somewhere. Either here or in the calculate itself. The reason why we need it is because C++ template classes don't automatically "inherit" type aliases from their base class templates (see https://godbolt.org/z/vvPPrcr4K), something with type needed to be template-dependent, I believe.

Given "why" we need this using (to fight C++), there can be argument made that we should do it here at the class definition and not inside calculate. I don't object to doing this move, but can you please confirm you really want it done?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if desired, may be better to do this move as separate PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, didn't see the extra use. Seems reasonable enough to me then.

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

calculate(DT, DT[this->Roots[0]]);
}

const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if desired, may be better to do this move as separate PR

@eas
Copy link
Contributor Author

eas commented Jan 29, 2026

@fhahn , @boomanaiden154 , I will need help to get this merged, thank you!

@boomanaiden154 boomanaiden154 merged commit 34b2fc6 into llvm:main Jan 29, 2026
10 of 11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 29, 2026

LLVM Buildbot has detected a new failure on builder lldb-x86_64-debian running on lldb-x86_64-debian while building llvm at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/39851

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: python_api/module_section/TestModuleAndSection.py (182 of 3368)
PASS: lldb-api :: types/TestShortTypeExpr.py (183 of 3368)
PASS: lldb-api :: commands/expression/char/TestExprsChar.py (184 of 3368)
PASS: lldb-api :: lang/c/bitfields/TestBitfields.py (185 of 3368)
PASS: lldb-api :: tools/lldb-dap/module-event/TestDAP_module_event.py (186 of 3368)
PASS: lldb-shell :: Subprocess/vfork-follow-child-wp.test (187 of 3368)
PASS: lldb-api :: functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py (188 of 3368)
PASS: lldb-api :: functionalities/gdb_remote_client/TestPlatformClient.py (189 of 3368)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-stl/generic/iterator/TestDataFormatterStdIterator.py (190 of 3368)
PASS: lldb-api :: lang/cpp/operators/TestCppOperators.py (191 of 3368)
FAIL: lldb-api :: tools/lldb-dap/evaluate/TestDAP_evaluate.py (192 of 3368)
******************** TEST 'lldb-api :: tools/lldb-dap/evaluate/TestDAP_evaluate.py' FAILED ********************
Script:
--
/usr/bin/python3 /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./lib --env LLVM_INCLUDE_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/include --env LLVM_TOOLS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./bin --arch x86_64 --build-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex --lldb-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/lldb --compiler /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/clang --dsymutil /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./bin --lldb-obj-root /home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb --lldb-libs-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./lib --cmake-build-type Release -t /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/evaluate -p TestDAP_evaluate.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 23.0.0git (https://github.com/llvm/llvm-project.git revision 34b2fc603c53d2690ae691bad28bc40b6658ffbb)
  clang revision 34b2fc603c53d2690ae691bad28bc40b6658ffbb
  llvm revision 34b2fc603c53d2690ae691bad28bc40b6658ffbb
Skipping the following test categories: libc++, msvcstl, dsym, pdb, gmodules, debugserver, objc

--
Command Output (stderr):
--
Change dir to: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/evaluate
runCmd: settings clear --all

output: 

runCmd: settings set symbols.enable-external-lookup false

output: 

runCmd: settings set target.inherit-tcc true

output: 

runCmd: settings set target.disable-aslr false

output: 

runCmd: settings set target.detach-on-error false

output: 


@eas eas deleted the dom-frontier-remove-unused branch January 29, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants