class DependenceInfo

Declaration

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

Description

DependenceInfo - This class is the main dependence-analysis driver.

Declared at: llvm/include/llvm/Analysis/DependenceAnalysis.h:271

Method Overview

  • public DependenceInfo(llvm::Function * F, llvm::AliasAnalysis * AA, llvm::ScalarEvolution * SE, llvm::LoopInfo * LI)
  • public std::unique_ptr<Dependence> depends(llvm::Instruction * Src, llvm::Instruction * Dst, bool PossiblyLoopIndependent)
  • public llvm::Function * getFunction() const
  • public const llvm::SCEV * getSplitIteration(const llvm::Dependence & Dep, unsigned int Level)
  • public bool invalidate(llvm::Function & F, const llvm::PreservedAnalyses & PA, FunctionAnalysisManager::Invalidator & Inv)

Methods

DependenceInfo(llvm::Function* F,
               llvm::AliasAnalysis* AA,
               llvm::ScalarEvolution* SE,
               llvm::LoopInfo* LI)

Declared at: llvm/include/llvm/Analysis/DependenceAnalysis.h:273

Parameters

llvm::Function* F
llvm::AliasAnalysis* AA
llvm::ScalarEvolution* SE
llvm::LoopInfo* LI

std::unique_ptr<Dependence> depends(
    llvm::Instruction* Src,
    llvm::Instruction* Dst,
    bool PossiblyLoopIndependent)

Description

depends - Tests for a dependence between the Src and Dst instructions. Returns NULL if no dependence; otherwise, returns a Dependence (or a FullDependence) with as much information as can be gleaned. The flag PossiblyLoopIndependent should be set by the caller if it appears that control flow can reach from Src to Dst without traversing a loop back edge.

Declared at: llvm/include/llvm/Analysis/DependenceAnalysis.h:287

Parameters

llvm::Instruction* Src
llvm::Instruction* Dst
bool PossiblyLoopIndependent

llvm::Function* getFunction() const

Declared at: llvm/include/llvm/Analysis/DependenceAnalysis.h:333

const llvm::SCEV* getSplitIteration(
    const llvm::Dependence& Dep,
    unsigned int Level)

Description

getSplitIteration - Give a dependence that's splittable at some particular level, return the iteration that should be used to split the loop. Generally, the dependence analyzer will be used to build a dependence graph for a function (basically a map from instructions to dependences). Looking for cycles in the graph shows us loops that cannot be trivially vectorized/parallelized. We can try to improve the situation by examining all the dependences that make up the cycle, looking for ones we can break. Sometimes, peeling the first or last iteration of a loop will break dependences, and there are flags for those possibilities. Sometimes, splitting a loop at some other iteration will do the trick, and we've got a flag for that case. Rather than waste the space to record the exact iteration (since we rarely know), we provide a method that calculates the iteration. It's a drag that it must work from scratch, but wonderful in that it's possible. Here's an example: for (i = 0; i < 10; i++) A[i] = ... ... = A[11 - i] There's a loop-carried flow dependence from the store to the load, found by the weak-crossing SIV test. The dependence will have a flag, indicating that the dependence can be broken by splitting the loop. Calling getSplitIteration will return 5. Splitting the loop breaks the dependence, like so: for (i = 0; i < = 5; i++) A[i] = ... ... = A[11 - i] for (i = 6; i < 10; i++) A[i] = ... ... = A[11 - i] breaks the dependence and allows us to vectorize/parallelize both loops.

Declared at: llvm/include/llvm/Analysis/DependenceAnalysis.h:331

Parameters

const llvm::Dependence& Dep
unsigned int Level

bool invalidate(
    llvm::Function& F,
    const llvm::PreservedAnalyses& PA,
    FunctionAnalysisManager::Invalidator& Inv)

Description

Handle transitive invalidation when the cached analysis results go away.

Declared at: llvm/include/llvm/Analysis/DependenceAnalysis.h:278

Parameters

llvm::Function& F
const llvm::PreservedAnalyses& PA
FunctionAnalysisManager::Invalidator& Inv