LLVM 20.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 = typename SyncDependenceAnalysisT::DivergenceDescriptor |
using | BlockLabelMapT = typename SyncDependenceAnalysisT::BlockLabelMap |
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 327 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::BlockLabelMapT = typename SyncDependenceAnalysisT::BlockLabelMap |
Definition at line 343 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::BlockT = typename ContextT::BlockT |
Definition at line 329 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::ConstValueRefT = typename ContextT::ConstValueRefT |
Definition at line 332 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::CycleInfoT = GenericCycleInfo<ContextT> |
Definition at line 337 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::CycleT = typename CycleInfoT::CycleT |
Definition at line 338 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::DivergenceDescriptorT = typename SyncDependenceAnalysisT::DivergenceDescriptor |
Definition at line 341 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::DominatorTreeT = typename ContextT::DominatorTreeT |
Definition at line 335 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::FunctionT = typename ContextT::FunctionT |
Definition at line 330 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::InstructionT = typename ContextT::InstructionT |
Definition at line 334 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::SyncDependenceAnalysisT = GenericSyncDependenceAnalysis<ContextT> |
Definition at line 340 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::UseT = typename ContextT::UseT |
Definition at line 333 of file GenericUniformityImpl.h.
using llvm::GenericUniformityAnalysisImpl< ContextT >::ValueRefT = typename ContextT::ValueRefT |
Definition at line 331 of file GenericUniformityImpl.h.
|
inline |
Definition at line 345 of file GenericUniformityImpl.h.
void llvm::GenericUniformityAnalysisImpl< ContextT >::addUniformOverride | ( | const InstructionT & | Instr | ) |
Mark UniVal
as a value that is always uniform.
Definition at line 811 of file GenericUniformityImpl.h.
|
protected |
Mark Term
as divergent and push all Instructions that become divergent as a result on the worklist.
Definition at line 1049 of file GenericUniformityImpl.h.
References A, assert(), B, llvm::CallingConv::C, llvm::dbgs(), llvm::getOutermostDivergentCycle(), llvm::insertIfNotContained(), llvm::DominatorTree::isReachableFromEntry(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::sort().
void llvm::GenericUniformityAnalysisImpl< ContextT >::compute |
Propagate divergence to all instructions in the region.
Divergence is seeded by calls to markDivergent
.
Definition at line 1105 of file GenericUniformityImpl.h.
References assert(), llvm::dbgs(), I, and LLVM_DEBUG.
|
inline |
Definition at line 352 of file GenericUniformityImpl.h.
References llvm::GenericUniformityAnalysisImpl< ContextT >::F.
|
inline |
Whether any value was marked or analyzed to be divergent.
Definition at line 373 of file GenericUniformityImpl.h.
References llvm::GenericUniformityAnalysisImpl< ContextT >::DivergentValues, and llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::empty().
bool llvm::GenericUniformityAnalysisImpl< SSAContext >::hasDivergentDefs | ( | const Instruction & | I | ) | const |
Definition at line 21 of file UniformityAnalysis.cpp.
References I.
bool llvm::GenericUniformityAnalysisImpl< ContextT >::hasDivergentDefs | ( | const InstructionT & | I | ) | const |
bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::hasDivergentDefs | ( | const MachineInstr & | I | ) | const |
Definition at line 21 of file MachineUniformityAnalysis.cpp.
|
inline |
Definition at line 393 of file GenericUniformityImpl.h.
References B, llvm::SmallPtrSetImpl< PtrType >::contains(), and llvm::GenericUniformityAnalysisImpl< ContextT >::DivergentTermBlocks.
void llvm::GenericUniformityAnalysisImpl< ContextT >::initialize | ( | ) |
void llvm::GenericUniformityAnalysisImpl< SSAContext >::initialize | ( | ) |
Definition at line 32 of file UniformityAnalysis.cpp.
References F, I, instructions, llvm::TargetTransformInfo::isAlwaysUniform(), and llvm::TargetTransformInfo::isSourceOfDivergence().
void llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::initialize | ( | ) |
Definition at line 49 of file MachineUniformityAnalysis.cpp.
References block, F, instr, 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 1133 of file GenericUniformityImpl.h.
|
inline |
Definition at line 381 of file GenericUniformityImpl.h.
References llvm::SmallPtrSetImpl< PtrType >::contains(), llvm::GenericUniformityAnalysisImpl< ContextT >::DivergentTermBlocks, llvm::GenericUniformityAnalysisImpl< ContextT >::hasDivergentDefs(), and I.
|
inline |
Whether Val
is divergent at its definition.
Definition at line 389 of file GenericUniformityImpl.h.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), and llvm::GenericUniformityAnalysisImpl< ContextT >::DivergentValues.
bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::isDivergentUse | ( | const MachineOperand & | U | ) | const |
Definition at line 131 of file MachineUniformityAnalysis.cpp.
References F.
bool llvm::GenericUniformityAnalysisImpl< SSAContext >::isDivergentUse | ( | const Use & | U | ) | const |
Definition at line 93 of file UniformityAnalysis.cpp.
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.
bool llvm::GenericUniformityAnalysisImpl< ContextT >::markDefsDivergent | ( | const InstructionT & | Instr | ) |
Mark outputs of Instr
as divergent.
bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::markDefsDivergent | ( | const MachineInstr & | Instr | ) |
void llvm::GenericUniformityAnalysisImpl< ContextT >::markDivergent | ( | const InstructionT & | I | ) |
Examine I
for divergent outputs and add to the worklist.
Definition at line 781 of file GenericUniformityImpl.h.
References llvm::dbgs(), I, and LLVM_DEBUG.
bool llvm::GenericUniformityAnalysisImpl< ContextT >::markDivergent | ( | ConstValueRefT | DivVal | ) |
Mark DivVal
as a divergent value.
DivVal
changed. Definition at line 801 of file GenericUniformityImpl.h.
References llvm::dbgs(), and LLVM_DEBUG.
void llvm::GenericUniformityAnalysisImpl< ContextT >::print | ( | raw_ostream & | out | ) | const |
|
protected |
Definition at line 411 of file GenericUniformityImpl.h.
|
protected |
Definition at line 409 of file GenericUniformityImpl.h.
|
protected |
Definition at line 416 of file GenericUniformityImpl.h.
Referenced by llvm::GenericUniformityAnalysisImpl< ContextT >::hasDivergentTerminator(), and llvm::GenericUniformityAnalysisImpl< ContextT >::isDivergent().
|
protected |
Definition at line 415 of file GenericUniformityImpl.h.
Referenced by llvm::GenericUniformityAnalysisImpl< ContextT >::hasDivergence(), and llvm::GenericUniformityAnalysisImpl< ContextT >::isDivergent().
|
protected |
Definition at line 410 of file GenericUniformityImpl.h.
Referenced by llvm::GenericUniformityAnalysisImpl< ContextT >::getFunction().
|
protected |
Definition at line 412 of file GenericUniformityImpl.h.
|
protected |
Definition at line 419 of file GenericUniformityImpl.h.