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) {
84 for (
auto *
User :
I.users()) {
85 auto *UserInstr = cast<Instruction>(
User);
86 if (DefCycle.
contains(UserInstr->getParent()))
88 markDivergent(*UserInstr);
95 const auto *V = U.get();
98 if (
const auto *DefInstr = dyn_cast<Instruction>(V)) {
99 const auto *UseInstr = cast<Instruction>(U.getUser());
100 return isTemporalDivergent(*UseInstr->getParent(), *DefInstr);
135 OS <<
"UniformityInfo for function '" <<
F.getName() <<
"':\n";
152 "Uniformity Analysis",
true,
true)
160 AU.setPreservesAll();
167 auto &cycleInfo = getAnalysis<CycleInfoWrapperPass>().getResult();
168 auto &domTree = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
169 auto &targetTransformInfo =
170 getAnalysis<TargetTransformInfoWrapperPass>().getTTI(
F);
173 m_uniformityInfo =
UniformityInfo{domTree, cycleInfo, &targetTransformInfo};
176 if (targetTransformInfo.hasBranchDivergence(m_function))
183 OS <<
"UniformityInfo for function '" << m_function->
getName() <<
"':\n";
188 m_function =
nullptr;
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)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
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.
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)
void initializeUniformityInfoWrapperPassPass(PassRegistry &)
A special type used by analysis passes to provide an address that identifies that particular analysis...