|
LLVM 24.0.0git
|
Analysis that identifies uniform values in a data-parallel execution. More...
#include "llvm/ADT/GenericUniformityImpl.h"
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 | 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 |
| bool | HasBranchDivergence = false |
| SmallPtrSet< const BlockT *, 32 > | DivergentTermBlocks |
| DenseSet< ConstValueRefT > | UniformValues |
| std::vector< const InstructionT * > | Worklist |
| SmallPtrSet< const InstructionT *, 8 > | CustomUniformityCandidates |
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 336 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::BlockLabelMapT = typename SyncDependenceAnalysisT::BlockLabelMap |
Definition at line 351 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::BlockT = typename ContextT::BlockT |
Definition at line 338 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::ConstValueRefT = typename ContextT::ConstValueRefT |
Definition at line 341 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::CycleInfoT = GenericCycleInfo<ContextT> |
Definition at line 346 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::DivergenceDescriptorT |
Definition at line 349 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::DominatorTreeT = typename ContextT::DominatorTreeT |
Definition at line 344 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::FunctionT = typename ContextT::FunctionT |
Definition at line 339 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::InstructionT = typename ContextT::InstructionT |
Definition at line 343 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::SyncDependenceAnalysisT = GenericSyncDependenceAnalysis<ContextT> |
Definition at line 348 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::TemporalDivergenceTuple |
Definition at line 353 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::UseT = typename ContextT::UseT |
Definition at line 342 of file GenericUniformityImpl.h.
| using llvm::GenericUniformityAnalysisImpl< ContextT >::ValueRefT = typename ContextT::ValueRefT |
Definition at line 340 of file GenericUniformityImpl.h.
|
inline |
Definition at line 356 of file GenericUniformityImpl.h.
References CI, Context, F, getFunction(), and TTI.
| void llvm::GenericUniformityAnalysisImpl< ContextT >::addCustomUniformityCandidate | ( | const InstructionT * | I | ) |
Add an instruction that requires custom uniformity analysis.
Definition at line 859 of file GenericUniformityImpl.h.
References CustomUniformityCandidates, and I.
Referenced by initialize().
| void llvm::GenericUniformityAnalysisImpl< ContextT >::addUniformOverride | ( | const InstructionT & | Instr | ) |
Mark UniVal as a value that is always uniform.
Definition at line 853 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 1095 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 1151 of file GenericUniformityImpl.h.
References analyzeControlDivergence(), assert(), Context, llvm::dbgs(), HasBranchDivergence, hasDivergentDefs(), I, LLVM_DEBUG, and Worklist.
|
inline |
Definition at line 365 of file GenericUniformityImpl.h.
References CI.
|
inline |
Definition at line 363 of file GenericUniformityImpl.h.
References F.
Referenced by GenericUniformityAnalysisImpl().
| bool llvm::GenericUniformityAnalysisImpl< SSAContext >::hasDivergentDefs | ( | const Instruction & | I | ) | const |
Definition at line 22 of file UniformityAnalysis.cpp.
References I, and isDivergent().
| bool llvm::GenericUniformityAnalysisImpl< ContextT >::hasDivergentDefs | ( | const InstructionT & | I | ) | const |
| bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::hasDivergentDefs | ( | const MachineInstr & | I | ) | const |
Definition at line 22 of file MachineUniformityAnalysis.cpp.
References I, and isDivergent().
|
inline |
Definition at line 415 of file GenericUniformityImpl.h.
References B(), and DivergentTermBlocks.
Referenced by print().
| void llvm::GenericUniformityAnalysisImpl< ContextT >::initialize | ( | ) |
| void llvm::GenericUniformityAnalysisImpl< SSAContext >::initialize | ( | ) |
Definition at line 68 of file UniformityAnalysis.cpp.
References addCustomUniformityCandidate(), addUniformOverride(), llvm::AlwaysUniform, llvm::Custom, llvm::Default, DivergentTermBlocks, F, I, instructions, llvm::NeverUniform, llvm::SmallVectorTemplateBase< T, bool >::push_back(), TTI, UniformValues, and Worklist.
| void llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::initialize | ( | ) |
Definition at line 50 of file MachineUniformityAnalysis.cpp.
References addUniformOverride(), llvm::AlwaysUniform, llvm::Custom, llvm::Default, F, markDivergent(), MBB, MI, llvm::NeverUniform, and UniformValues.
| bool llvm::GenericUniformityAnalysisImpl< ContextT >::isAlwaysUniform | ( | const InstructionT & | Instr | ) | const |
Whether Val will always return a uniform value regardless of its operands.
Definition at line 1180 of file GenericUniformityImpl.h.
Referenced by markDivergent().
| bool llvm::GenericUniformityAnalysisImpl< ContextT >::isCustomUniform | ( | const InstructionT & | I | ) | const |
Check if an instruction with Custom uniformity can be proven uniform based on its operands.
This queries the target-specific callback.
References I.
Referenced by markDivergent().
|
inline |
Whether Val is divergent at its definition.
When the target has no branch divergence, compute() is never called and everything is uniform. Otherwise, values not in UniformValues (e.g. newly created) are conservatively treated as divergent.
Definition at line 401 of file GenericUniformityImpl.h.
References HasBranchDivergence, and UniformValues.
Referenced by hasDivergentDefs(), hasDivergentDefs(), isDivergentUse(), isDivergentUse(), print(), and printDivergentArgs().
|
inline |
Definition at line 392 of file GenericUniformityImpl.h.
References assert(), DivergentTermBlocks, and I.
| bool llvm::GenericUniformityAnalysisImpl< MachineSSAContext >::isDivergentUse | ( | const MachineOperand & | U | ) | const |
Definition at line 151 of file MachineUniformityAnalysis.cpp.
References F, and isDivergent().
| bool llvm::GenericUniformityAnalysisImpl< SSAContext >::isDivergentUse | ( | const Use & | U | ) | const |
Definition at line 137 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 28 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.
References assert(), F, markDivergent(), and TRI.
| void llvm::GenericUniformityAnalysisImpl< ContextT >::markDivergent | ( | const InstructionT & | I | ) |
Examine I for divergent outputs and add to the worklist.
Definition at line 816 of file GenericUniformityImpl.h.
References Context, CustomUniformityCandidates, llvm::dbgs(), DivergentTermBlocks, I, isAlwaysUniform(), isCustomUniform(), LLVM_DEBUG, markDefsDivergent(), and Worklist.
Referenced by initialize(), markDefsDivergent(), and markDefsDivergent().
| bool llvm::GenericUniformityAnalysisImpl< ContextT >::markDivergent | ( | ConstValueRefT | DivVal | ) |
Mark DivVal as a divergent value by removing it from UniformValues.
DivVal changed. Definition at line 843 of file GenericUniformityImpl.h.
References Context, llvm::dbgs(), LLVM_DEBUG, and UniformValues.
| void llvm::GenericUniformityAnalysisImpl< ContextT >::print | ( | raw_ostream & | Out | ) | const |
Definition at line 1199 of file GenericUniformityImpl.h.
References llvm::Block, llvm::CallingConv::C, CI, Context, F, hasDivergentTerminator(), isDivergent(), printDivergentArgs(), T, and TemporalDivergenceList.
| bool llvm::GenericUniformityAnalysisImpl< SSAContext >::printDivergentArgs | ( | raw_ostream & | OS | ) | const |
Definition at line 53 of file UniformityAnalysis.cpp.
References Context, F, and isDivergent().
| bool llvm::GenericUniformityAnalysisImpl< ContextT >::printDivergentArgs | ( | raw_ostream & | Out | ) | const |
Print divergent arguments and return true if any were found.
IR specialization iterates F.args(); default is a no-op.
Definition at line 1186 of file GenericUniformityImpl.h.
Referenced by print().
| void llvm::GenericUniformityAnalysisImpl< ContextT >::recordTemporalDivergence | ( | ConstValueRefT | Val, |
| const InstructionT * | User, | ||
| CycleRef | C ) |
Definition at line 1174 of file GenericUniformityImpl.h.
References llvm::CallingConv::C, and TemporalDivergenceList.
|
protected |
Definition at line 439 of file GenericUniformityImpl.h.
Referenced by analyzeControlDivergence(), GenericUniformityAnalysisImpl(), getCycleInfo(), and print().
|
protected |
Definition at line 437 of file GenericUniformityImpl.h.
Referenced by analyzeControlDivergence(), compute(), GenericUniformityAnalysisImpl(), markDivergent(), markDivergent(), print(), and printDivergentArgs().
|
protected |
Definition at line 459 of file GenericUniformityImpl.h.
Referenced by addCustomUniformityCandidate(), and markDivergent().
|
protected |
Definition at line 447 of file GenericUniformityImpl.h.
Referenced by analyzeControlDivergence(), hasDivergentTerminator(), initialize(), isDivergentTerminator(), and markDivergent().
|
protected |
Definition at line 438 of file GenericUniformityImpl.h.
Referenced by GenericUniformityAnalysisImpl(), getFunction(), initialize(), isDivergentUse(), markDefsDivergent(), print(), and printDivergentArgs().
|
protected |
Definition at line 445 of file GenericUniformityImpl.h.
Referenced by compute(), and isDivergent().
| SmallVector<TemporalDivergenceTuple, 8> llvm::GenericUniformityAnalysisImpl< ContextT >::TemporalDivergenceList |
Definition at line 425 of file GenericUniformityImpl.h.
Referenced by print(), and recordTemporalDivergence().
|
protected |
Definition at line 440 of file GenericUniformityImpl.h.
Referenced by GenericUniformityAnalysisImpl(), and initialize().
|
protected |
Definition at line 452 of file GenericUniformityImpl.h.
Referenced by initialize(), isDivergent(), and markDivergent().
|
protected |
Definition at line 455 of file GenericUniformityImpl.h.
Referenced by compute(), initialize(), and markDivergent().