24 return isDivergent((
const Value *)&
I);
30 return markDivergent(cast<Value>(&Instr));
38 addUniformOverride(
I);
40 for (
auto &Arg :
F.args()) {
50 for (
const auto *
User : V->users()) {
51 if (
const auto *UserInstr = dyn_cast<const Instruction>(
User)) {
52 markDivergent(*UserInstr);
60 assert(!isAlwaysUniform(Instr));
61 if (
Instr.isTerminator())
63 pushUsers(cast<Value>(&Instr));
70 for (
const Use &U :
I.operands()) {
71 if (
auto *
I = dyn_cast<Instruction>(&U)) {
82 const Cycle &DefCycle) {
85 for (
auto *
User :
I.users()) {
86 auto *UserInstr = cast<Instruction>(
User);
87 if (DefCycle.
contains(UserInstr->getParent()))
89 markDivergent(*UserInstr);
96 const auto *V = U.get();
99 if (
const auto *DefInstr = dyn_cast<Instruction>(V)) {
100 const auto *UseInstr = cast<Instruction>(U.getUser());
101 return isTemporalDivergent(*UseInstr->getParent(), *DefInstr);
136 OS <<
"UniformityInfo for function '" <<
F.getName() <<
"':\n";
153 "Uniformity Analysis",
true,
true)
161 AU.setPreservesAll();
168 auto &cycleInfo = getAnalysis<CycleInfoWrapperPass>().getResult();
169 auto &domTree = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
170 auto &targetTransformInfo =
171 getAnalysis<TargetTransformInfoWrapperPass>().getTTI(
F);
174 m_uniformityInfo =
UniformityInfo{domTree, cycleInfo, &targetTransformInfo};
177 if (targetTransformInfo.hasBranchDivergence(m_function))
184 OS <<
"UniformityInfo for function '" << m_function->
getName() <<
"':\n";
189 m_function =
nullptr;
Expand Atomic instructions
block Block Frequency Analysis
This file contains the declarations for the subclasses of Constant, which represent the different fla...
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...