LLVM 22.0.0git
|
Analysis that identifies uniform values in a data-parallel execution. More...
#include "llvm/ADT/GenericUniformityImpl.h"
Classes | |
struct | PhiInput |
Value/block pair representing a single phi input. More... |
Public Types | |
using | BlockT = typename ContextT::BlockT |
using | FunctionT = typename ContextT::FunctionT |
using | ValueRefT = typename ContextT::ValueRefT |
using | ConstValueRefT = typename ContextT::ConstValueRefT |
using | UseT = typename ContextT::UseT |
using | InstructionT = typename ContextT::InstructionT |
using | DominatorTreeT = typename ContextT::DominatorTreeT |
using | CycleInfoT = GenericCycleInfo<ContextT> |
using | CycleT = typename CycleInfoT::CycleT |
using | SyncDependenceAnalysisT = GenericSyncDependenceAnalysis<ContextT> |
using | DivergenceDescriptorT |
using | BlockLabelMapT = typename SyncDependenceAnalysisT::BlockLabelMap |
using | TemporalDivergenceTuple |
Public Attributes | |
SmallVector< TemporalDivergenceTuple, 8 > | TemporalDivergenceList |
Protected Member Functions | |
void | analyzeControlDivergence (const InstructionT &Term) |
Mark Term as divergent and push all Instructions that become divergent as a result on the worklist. |
Protected Attributes | |
const ContextT & | Context |
const FunctionT & | F |
const CycleInfoT & | CI |
const TargetTransformInfo * | TTI = nullptr |
DenseSet< ConstValueRefT > | DivergentValues |
SmallPtrSet< const BlockT *, 32 > | DivergentTermBlocks |
std::vector< const InstructionT * > | Worklist |
Analysis that identifies uniform values in a data-parallel execution.
This analysis propagates divergence in a data-parallel context from sources of divergence to all users. It can be instantiated for an IR that provides a suitable SSAContext.
Definition at line 330 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::BlockLabelMapT = typename SyncDependenceAnalysisT::BlockLabelMap |
Definition at line 346 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::BlockT = typename ContextT::BlockT |
Definition at line 332 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::ConstValueRefT = typename ContextT::ConstValueRefT |
Definition at line 335 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::CycleInfoT = GenericCycleInfo<ContextT> |
Definition at line 340 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::CycleT = typename CycleInfoT::CycleT |
Definition at line 341 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::DivergenceDescriptorT |
Definition at line 344 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::DominatorTreeT = typename ContextT::DominatorTreeT |
Definition at line 338 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::FunctionT = typename ContextT::FunctionT |
Definition at line 333 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::InstructionT = typename ContextT::InstructionT |
Definition at line 337 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::SyncDependenceAnalysisT = GenericSyncDependenceAnalysis<ContextT> |
Definition at line 343 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::TemporalDivergenceTuple |
Definition at line 348 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::UseT = typename ContextT::UseT |
Definition at line 336 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::ValueRefT = typename ContextT::ValueRefT |
Definition at line 334 of file GenericUniformityImpl.h.
|
inline |
Definition at line 351 of file GenericUniformityImpl.h.
References CI, Context, F, getFunction(), and TTI.
void llvm::GenericUniformityAnalysisImpl< ContextT >::addUniformOverride | ( | const InstructionT & | Instr | ) |
Mark UniVal
as a value that is always uniform.
Definition at line 827 of file GenericUniformityImpl.h.
Referenced by initialize().
|
protected |
Mark Term
as divergent and push all Instructions that become divergent as a result on the worklist.
Definition at line 1065 of file GenericUniformityImpl.h.
References A(), assert(), B(), llvm::CallingConv::C, CI, Context, llvm::dbgs(), DivergentTermBlocks, llvm::getOutermostDivergentCycle(), llvm::insertIfNotContained(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::sort().
Referenced by compute().
void llvm::GenericUniformityAnalysisImpl< ContextT >::compute | ( | ) |
Propagate divergence to all instructions in the region.
Divergence is seeded by calls to markDivergent
.
Definition at line 1121 of file GenericUniformityImpl.h.
References analyzeControlDivergence(), assert(), Context, llvm::dbgs(), DivergentValues, I, isDivergent(), LLVM_DEBUG, and Worklist.
|
inline |
Definition at line 358 of file GenericUniformityImpl.h.
References F.
Referenced by GenericUniformityAnalysisImpl().
|
inline |
Whether any value was marked or analyzed to be divergent.
Definition at line 379 of file GenericUniformityImpl.h.
References DivergentValues.
bool llvm::GenericUniformityAnalysisImpl< SSAContext >::hasDivergentDefs | ( | const Instruction & | I | ) | const |
Definition at line 21 of file UniformityAnalysis.cpp.
References I, and isDivergent().
bool llvm::GenericUniformityAnalysisImpl< ContextT >::hasDivergentDefs | ( | const InstructionT & | I | ) | const |
References I.
Referenced by isDivergent().
bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::hasDivergentDefs | ( | const MachineInstr & | I | ) | const |
Definition at line 22 of file MachineUniformityAnalysis.cpp.
References I, isDivergent(), and op.
|
inline |
Definition at line 399 of file GenericUniformityImpl.h.
References B(), and DivergentTermBlocks.
Referenced by print().
void llvm::GenericUniformityAnalysisImpl< ContextT >::initialize | ( | ) |
void llvm::GenericUniformityAnalysisImpl< SSAContext >::initialize | ( | ) |
Definition at line 32 of file UniformityAnalysis.cpp.
References addUniformOverride(), F, I, instructions, markDivergent(), and TTI.
void llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::initialize | ( | ) |
Definition at line 50 of file MachineUniformityAnalysis.cpp.
References addUniformOverride(), llvm::AlwaysUniform, block, F, instr, markDivergent(), llvm::NeverUniform, and uniformity.
bool llvm::GenericUniformityAnalysisImpl< ContextT >::isAlwaysUniform | ( | const InstructionT & | Instr | ) | const |
Whether Val
will always return a uniform value regardless of its operands.
Definition at line 1156 of file GenericUniformityImpl.h.
Referenced by markDivergent().
|
inline |
Definition at line 387 of file GenericUniformityImpl.h.
References DivergentTermBlocks, hasDivergentDefs(), and I.
Referenced by compute(), hasDivergentDefs(), hasDivergentDefs(), isDivergentUse(), isDivergentUse(), and print().
|
inline |
Whether Val
is divergent at its definition.
Definition at line 395 of file GenericUniformityImpl.h.
References DivergentValues.
bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::isDivergentUse | ( | const MachineOperand & | U | ) | const |
Definition at line 132 of file MachineUniformityAnalysis.cpp.
References F, and isDivergent().
bool llvm::GenericUniformityAnalysisImpl< SSAContext >::isDivergentUse | ( | const Use & | U | ) | const |
Definition at line 92 of file UniformityAnalysis.cpp.
References llvm::cast(), llvm::dyn_cast(), and isDivergent().
bool llvm::GenericUniformityAnalysisImpl< ContextT >::isDivergentUse | ( | const UseT & | U | ) | const |
bool llvm::GenericUniformityAnalysisImpl< SSAContext >::markDefsDivergent | ( | const Instruction & | Instr | ) |
Definition at line 27 of file UniformityAnalysis.cpp.
References llvm::cast(), and markDivergent().
bool llvm::GenericUniformityAnalysisImpl< ContextT >::markDefsDivergent | ( | const InstructionT & | Instr | ) |
Mark outputs of Instr
as divergent.
Referenced by markDivergent().
bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::markDefsDivergent | ( | const MachineInstr & | Instr | ) |
Definition at line 32 of file MachineUniformityAnalysis.cpp.
void llvm::GenericUniformityAnalysisImpl< ContextT >::markDivergent | ( | const InstructionT & | I | ) |
Examine I
for divergent outputs and add to the worklist.
Definition at line 797 of file GenericUniformityImpl.h.
References Context, llvm::dbgs(), DivergentTermBlocks, I, isAlwaysUniform(), LLVM_DEBUG, markDefsDivergent(), and Worklist.
Referenced by initialize(), markDefsDivergent(), and markDefsDivergent().
bool llvm::GenericUniformityAnalysisImpl< ContextT >::markDivergent | ( | ConstValueRefT | DivVal | ) |
Mark DivVal
as a divergent value.
DivVal
changed. Definition at line 817 of file GenericUniformityImpl.h.
References Context, llvm::dbgs(), DivergentValues, and LLVM_DEBUG.
void llvm::GenericUniformityAnalysisImpl< ContextT >::print | ( | raw_ostream & | out | ) | const |
Definition at line 1169 of file GenericUniformityImpl.h.
References block, Context, DivergentTermBlocks, DivergentValues, F, hasDivergentTerminator(), isDivergent(), T, and TemporalDivergenceList.
void llvm::GenericUniformityAnalysisImpl< ContextT >::recordTemporalDivergence | ( | ConstValueRefT | Val, |
const InstructionT * | User, | ||
const CycleT * | Cycle ) |
Definition at line 1149 of file GenericUniformityImpl.h.
References TemporalDivergenceList.
|
protected |
Definition at line 422 of file GenericUniformityImpl.h.
Referenced by analyzeControlDivergence(), and GenericUniformityAnalysisImpl().
|
protected |
Definition at line 420 of file GenericUniformityImpl.h.
Referenced by analyzeControlDivergence(), compute(), GenericUniformityAnalysisImpl(), markDivergent(), markDivergent(), and print().
|
protected |
Definition at line 427 of file GenericUniformityImpl.h.
Referenced by analyzeControlDivergence(), hasDivergentTerminator(), isDivergent(), markDivergent(), and print().
|
protected |
Definition at line 426 of file GenericUniformityImpl.h.
Referenced by compute(), hasDivergence(), isDivergent(), markDivergent(), and print().
|
protected |
Definition at line 421 of file GenericUniformityImpl.h.
Referenced by GenericUniformityAnalysisImpl(), getFunction(), initialize(), isDivergentUse(), markDefsDivergent(), and print().
SmallVector<TemporalDivergenceTuple, 8> llvm::GenericUniformityAnalysisImpl< ContextT >::TemporalDivergenceList |
Definition at line 405 of file GenericUniformityImpl.h.
Referenced by print(), and recordTemporalDivergence().
|
protected |
Definition at line 423 of file GenericUniformityImpl.h.
Referenced by GenericUniformityAnalysisImpl(), and initialize().
|
protected |
Definition at line 430 of file GenericUniformityImpl.h.
Referenced by compute(), and markDivergent().