23 return isDivergent((
const Value *)&
I);
29 return markDivergent(cast<Value>(&Instr));
37 addUniformOverride(
I);
39 for (
auto &Arg :
F.args()) {
49 for (
const auto *
User : V->users()) {
50 if (
const auto *UserInstr = dyn_cast<const Instruction>(
User)) {
51 markDivergent(*UserInstr);
59 assert(!isAlwaysUniform(Instr));
60 if (
Instr.isTerminator())
62 pushUsers(cast<Value>(&Instr));
69 for (
const Use &U :
I.operands()) {
70 if (
auto *
I = dyn_cast<Instruction>(&U)) {
81 const Cycle &DefCycle) {
82 for (
auto *
User :
I.users()) {
83 auto *UserInstr = cast<Instruction>(
User);
84 if (DefCycle.
contains(UserInstr->getParent()))
86 markDivergent(*UserInstr);
87 recordTemporalDivergence(&
I, UserInstr, &DefCycle);
94 const auto *V = U.get();
97 if (
const auto *DefInstr = dyn_cast<Instruction>(V)) {
98 const auto *UseInstr = cast<Instruction>(U.getUser());
99 return isTemporalDivergent(*UseInstr->getParent(), *DefInstr);
134 OS <<
"UniformityInfo for function '" <<
F.getName() <<
"':\n";
149 "Uniformity Analysis",
false,
true)
157 AU.setPreservesAll();
164 auto &cycleInfo = getAnalysis<CycleInfoWrapperPass>().getResult();
165 auto &domTree = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
166 auto &targetTransformInfo =
167 getAnalysis<TargetTransformInfoWrapperPass>().getTTI(
F);
170 m_uniformityInfo =
UniformityInfo{domTree, cycleInfo, &targetTransformInfo};
173 if (targetTransformInfo.hasBranchDivergence(m_function))
180 OS <<
"UniformityInfo for function '" << m_function->
getName() <<
"':\n";
186 m_function =
nullptr;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Expand Atomic instructions
block Block Frequency Analysis
This file declares an analysis pass that computes CycleInfo for LLVM IR, specialized from GenericCycl...
FunctionAnalysisManager FAM
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
Analysis pass which computes a CycleInfo.
Legacy analysis pass which computes a CycleInfo.
Analysis pass which computes a DominatorTree.
Legacy analysis pass which computes a DominatorTree.
FunctionPass class - This class is used to implement most global optimizations.
A possibly irreducible generalization of a Loop.
bool contains(const BlockT *Block) const
Return whether Block is contained in the cycle.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Analysis pass providing the TargetTransformInfo.
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
This class implements an extremely fast bulk output stream that can only output to a stream.
NodeAddr< InstrNode * > Instr
This is an optimization pass for GlobalISel generic memory operations.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
A special type used by analysis passes to provide an address that identifies that particular analysis...