diff options
| author | alex-t <alex-t@users.noreply.github.com> | 2025-07-03 18:37:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-03 18:37:37 +0200 |
| commit | 8ac7210b7f0ad49ae7809bf6a9faf2f7433384b0 (patch) | |
| tree | 3efe700c2631a06ab4d0c2233bf6cfc6489c3a3a /llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp | |
| parent | b6e113a149bfa196a90a260f69f06b0070bd3670 (diff) | |
[AMDGPU] SelectionDAG divergence tracking should take into account Target divergency. (#144947)
If a kernel is known to be executing only a single lane, IR
UniformityAnalysis will take note of that (via
GCNTTIImpl::hasBranchDivergence) and report that all values are uniform.
SelectionDAG's built-in divergence tracking should do the same.
Diffstat (limited to 'llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp')
| -rw-r--r-- | llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp b/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp index 360fc9c8af84..d3f1a87572e2 100644 --- a/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp +++ b/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp @@ -9,6 +9,7 @@ #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h" #include "llvm/Analysis/MemoryLocation.h" #include "llvm/Analysis/OptimizationRemarkEmitter.h" +#include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/AsmParser/Parser.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/SelectionDAG.h" @@ -78,8 +79,12 @@ protected: if (!DAG) report_fatal_error("DAG?"); OptimizationRemarkEmitter ORE(F); + FunctionAnalysisManager FAM; + FAM.registerPass([&] { return TM->getTargetIRAnalysis(); }); + + TargetTransformInfo &TTI = FAM.getResult<TargetIRAnalysis>(*F); DAG->init(*MF, ORE, nullptr, nullptr, nullptr, nullptr, nullptr, MMI, - nullptr); + nullptr, TTI.hasBranchDivergence()); } TargetLoweringBase::LegalizeTypeAction getTypeAction(EVT VT) { |
