16 #ifndef LLVM_ANALYSIS_DIVERGENCE_ANALYSIS_H 17 #define LLVM_ANALYSIS_DIVERGENCE_ANALYSIS_H 31 class TargetTransformInfo;
83 bool updateTerminator(
const Instruction &Term)
const;
84 bool updatePHINode(
const PHINode &Phi)
const;
92 bool updateNormalInstruction(
const Instruction &Inst)
const;
100 void taintLoopLiveOuts(
const BasicBlock &LoopHeader);
103 void pushUsers(
const Value &I);
112 void markBlockJoinDivergent(
const BasicBlock &Block) {
113 DivergentJoinBlocks.insert(&Block);
117 bool isTemporalDivergent(
const BasicBlock &ObservingBlock,
118 const Value &Val)
const;
123 bool isJoinDivergent(
const BasicBlock &Block)
const {
124 return DivergentJoinBlocks.find(&Block) != DivergentJoinBlocks.end();
133 bool propagateJoinDivergence(
const BasicBlock &JoinBlock,
134 const Loop *TermLoop);
138 void propagateBranchDivergence(
const Instruction &Term);
143 void propagateLoopDivergence(
const Loop &ExitingLoop);
149 const Loop *RegionLoop;
173 std::vector<const Instruction *> Worklist;
205 #endif // LLVM_ANALYSIS_DIVERGENCE_ANALYSIS_H This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
void addUniformOverride(const Value &UniVal)
Mark UniVal as a value that is always uniform.
Implements a dense probed hash-table based set.
Generic divergence analysis for reducible CFGs.
Divergence analysis frontend for GPU kernels.
DivergenceAnalysis(const Function &F, const Loop *RegionLoop, const DominatorTree &DT, const LoopInfo &LI, SyncDependenceAnalysis &SDA, bool IsLCSSAForm)
This instance will analyze the whole function F or the loop RegionLoop.
void compute()
Propagate divergence to all instructions in the region.
const Function & getFunction() const
const Function & getFunction() const
The GPU kernel this analysis result is for.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
LLVM Basic Block Representation.
bool isUniform(const Value &V) const
Whether V is uniform/non-divergent.
bool hasDetectedDivergence() const
Whether any value was marked or analyzed to be divergent.
Relates points of divergent control to join points in reducible CFGs.
const Loop * getRegionLoop() const
The loop that defines the analyzed region (if any).
bool hasDivergence() const
Whether any divergence was detected.
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
Represents a single loop in the control flow graph.
bool inRegion(const BasicBlock &BB) const
Whether BB is part of the region.
bool isDivergent(const Value &Val) const
Whether Val is a divergent value.
bool isAlwaysUniform(const Value &Val) const
Whether Val will always return a uniform value regardless of its operands.
void markDivergent(const Value &DivVal)
Mark DivVal as a value that is always divergent.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
void print(raw_ostream &OS, const Module *) const