class DivergenceAnalysis

Declaration

class DivergenceAnalysis { /* full declaration omitted */ };

Description

Generic divergence analysis for reducible CFGs.

This analysis propagates divergence in a data-parallel context from sources of divergence to all users. It requires reducible CFGs. All assignments should be in SSA form.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:37

Method Overview

Methods

DivergenceAnalysis(
    const llvm::Function& F,
    const llvm::Loop* RegionLoop,
    const llvm::DominatorTree& DT,
    const llvm::LoopInfo& LI,
    llvm::SyncDependenceAnalysis& SDA,
    bool IsLCSSAForm)

Description

This instance will analyze the whole function \p F or the loop \p RegionLoop.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:46

Parameters

const llvm::Function& F
const llvm::Loop* RegionLoop
if non-null the analysis is restricted to \p RegionLoop. Otherwise the whole function is analyzed.
const llvm::DominatorTree& DT
const llvm::LoopInfo& LI
llvm::SyncDependenceAnalysis& SDA
bool IsLCSSAForm
whether the analysis may assume that the IR in the region in in LCSSA form.

void addUniformOverride(const llvm::Value& UniVal)

Description

Mark \p UniVal as a value that is always uniform.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:60

Parameters

const llvm::Value& UniVal

void compute()

Description

Propagate divergence to all instructions in the region. Divergence is seeded by calls to \p markDivergent.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:67

const llvm::Function& getFunction() const

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:52

const llvm::Loop* getRegionLoop() const

Description

The loop that defines the analyzed region (if any).

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:51

bool hasDetectedDivergence() const

Description

Whether any value was marked or analyzed to be divergent.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:70

bool inRegion(const llvm::BasicBlock& BB) const

Description

Whether \p BB is part of the region.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:55

Parameters

const llvm::BasicBlock& BB

bool inRegion(const llvm::Instruction& I) const

Description

Whether \p I is part of the region.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:57

Parameters

const llvm::Instruction& I

bool isAlwaysUniform(const llvm::Value& Val) const

Description

Whether \p Val will always return a uniform value regardless of its operands

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:74

Parameters

const llvm::Value& Val

bool isDivergent(const llvm::Value& Val) const

Description

Whether \p Val is divergent at its definition.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:77

Parameters

const llvm::Value& Val

bool isDivergentUse(const llvm::Use& U) const

Description

Whether \p U is divergent. Uses of a uniform value can be divergent.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:80

Parameters

const llvm::Use& U

void markDivergent(const llvm::Value& DivVal)

Description

Mark \p DivVal as a value that is always divergent.

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:63

Parameters

const llvm::Value& DivVal

void print(llvm::raw_ostream& OS,
           const llvm::Module*) const

Declared at: llvm/include/llvm/Analysis/DivergenceAnalysis.h:82

Parameters

llvm::raw_ostream& OS
const llvm::Module*