From 15f72dbf972f056b1685786e5118148fb528f233 Mon Sep 17 00:00:00 2001 From: Andreas Bolka Date: Wed, 29 Jul 2009 05:35:53 +0000 Subject: Skeleton for pairwise subscript testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77437 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/LoopDependenceAnalysis.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/llvm/Analysis/LoopDependenceAnalysis.h b/include/llvm/Analysis/LoopDependenceAnalysis.h index 3eab665..56a6b6e 100644 --- a/include/llvm/Analysis/LoopDependenceAnalysis.h +++ b/include/llvm/Analysis/LoopDependenceAnalysis.h @@ -21,6 +21,7 @@ #define LLVM_ANALYSIS_LOOP_DEPENDENCE_ANALYSIS_H #include "llvm/ADT/FoldingSet.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Support/Allocator.h" #include @@ -30,6 +31,7 @@ namespace llvm { class AliasAnalysis; class AnalysisUsage; class ScalarEvolution; +class SCEV; class Value; class raw_ostream; @@ -43,17 +45,21 @@ class LoopDependenceAnalysis : public LoopPass { /// TODO: doc enum DependenceResult { Independent = 0, Dependent = 1, Unknown = 2 }; + /// TODO: doc + struct Subscript { + /// TODO: Add distance, direction, breaking conditions, ... + }; + /// DependencePair - Represents a data dependence relation between to memory /// reference instructions. - /// - /// TODO: add subscripts vector struct DependencePair : public FastFoldingSetNode { Value *A; Value *B; DependenceResult Result; + SmallVector Subscripts; DependencePair(const FoldingSetNodeID &ID, Value *a, Value *b) : - FastFoldingSetNode(ID), A(a), B(b), Result(Unknown) {} + FastFoldingSetNode(ID), A(a), B(b), Result(Unknown), Subscripts() {} }; /// findOrInsertDependencePair - Return true if a DependencePair for the @@ -62,7 +68,8 @@ class LoopDependenceAnalysis : public LoopPass { bool findOrInsertDependencePair(Value*, Value*, DependencePair*&); /// TODO: doc - DependenceResult analysePair(DependencePair *P) const; + DependenceResult analyseSubscript(const SCEV*, const SCEV*, Subscript*) const; + DependenceResult analysePair(DependencePair*) const; public: static char ID; // Class identification, replacement for typeinfo @@ -88,7 +95,6 @@ private: BumpPtrAllocator PairAllocator; }; // class LoopDependenceAnalysis - // createLoopDependenceAnalysisPass - This creates an instance of the // LoopDependenceAnalysis pass. // -- cgit v1.1