24#define DEBUG_TYPE "amdgpu-annotate-uniform"
30class AMDGPUAnnotateUniformValues
39 I->setMetadata(
"amdgpu.uniform",
MDNode::get(
I->getContext(), {}));
44 I->setMetadata(
"amdgpu.noclobber",
MDNode::get(
I->getContext(), {}));
51 : UA(&UA), MSSA(&MSSA),
AA(&
AA),
57 bool changed()
const {
return Changed; }
62void AMDGPUAnnotateUniformValues::visitBranchInst(
BranchInst &
I) {
64 setUniformMetadata(&
I);
67void AMDGPUAnnotateUniformValues::visitLoadInst(LoadInst &
I) {
73 setUniformMetadata(PtrI);
82 setNoClobberMetadata(&
I);
92 AMDGPUAnnotateUniformValues Impl(UI, MSSA,
AA,
F);
114 return "AMDGPU Annotate Uniform Values";
134 AMDGPUAnnotateUniformValues Impl(UI, MSSA,
AA,
F);
136 return Impl.changed();
140 "Add AMDGPU uniform metadata",
false,
false)
static bool runOnFunction(Function &F, bool PostInlining)
This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...
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 manager for alias analyses.
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
Conditional or Unconditional Branch instruction.
Represents analyses that only rely on functions' control flow.
FunctionPass class - This class is used to implement most global optimizations.
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.
Base class for instruction visitors.
An instruction for reading from memory.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
An analysis that produces MemorySSA for a function.
Legacy analysis pass which computes MemorySSA.
Encapsulates MemorySSA, including all data associated with memory accesses.
A Module instance is used to store all the information related to an LLVM module.
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
StringRef - Represent a constant reference to a string, i.e.
Abstract Attribute helper functions.
@ GLOBAL_ADDRESS
Address space for global memory (RAT0, VTX0).
LLVM_READNONE constexpr bool isEntryFunctionCC(CallingConv::ID CC)
bool isClobberedInFunction(const LoadInst *Load, MemorySSA *MSSA, AAResults *AA)
Check is a Load is clobbered in its function.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
This is an optimization pass for GlobalISel generic memory operations.
GenericUniformityInfo< SSAContext > UniformityInfo
FunctionAddr VTableAddr Value
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
FunctionPass * createAMDGPUAnnotateUniformValuesLegacy()
AAResults AliasAnalysis
Temporary typedef for legacy code that uses a generic AliasAnalysis pointer or reference.