summaryrefslogtreecommitdiff
path: root/llvm/include/llvm/Analysis/DependenceAnalysis.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Analysis/DependenceAnalysis.h')
-rw-r--r--llvm/include/llvm/Analysis/DependenceAnalysis.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h
index 0c4002c3c3ba..305c9b1d88f2 100644
--- a/llvm/include/llvm/Analysis/DependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h
@@ -40,12 +40,13 @@
#define LLVM_ANALYSIS_DEPENDENCEANALYSIS_H
#include "llvm/ADT/SmallBitVector.h"
-#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/IR/Instructions.h"
+#include "llvm/IR/PassManager.h"
#include "llvm/Pass.h"
namespace llvm {
-template <typename T> class ArrayRef;
+ class AAResults;
+ template <typename T> class ArrayRef;
class Loop;
class LoopInfo;
class ScalarEvolution;
@@ -270,7 +271,7 @@ template <typename T> class ArrayRef;
///
class DependenceInfo {
public:
- DependenceInfo(Function *F, AliasAnalysis *AA, ScalarEvolution *SE,
+ DependenceInfo(Function *F, AAResults *AA, ScalarEvolution *SE,
LoopInfo *LI)
: AA(AA), SE(SE), LI(LI), F(F) {}
@@ -333,7 +334,7 @@ template <typename T> class ArrayRef;
Function *getFunction() const { return F; }
private:
- AliasAnalysis *AA;
+ AAResults *AA;
ScalarEvolution *SE;
LoopInfo *LI;
Function *F;
@@ -924,10 +925,28 @@ template <typename T> class ArrayRef;
void updateDirection(Dependence::DVEntry &Level,
const Constraint &CurConstraint) const;
+ /// Given a linear access function, tries to recover subscripts
+ /// for each dimension of the array element access.
bool tryDelinearize(Instruction *Src, Instruction *Dst,
SmallVectorImpl<Subscript> &Pair);
- private:
+ /// Tries to delinearize access function for a fixed size multi-dimensional
+ /// array, by deriving subscripts from GEP instructions. Returns true upon
+ /// success and false otherwise.
+ bool tryDelinearizeFixedSize(Instruction *Src, Instruction *Dst,
+ const SCEV *SrcAccessFn,
+ const SCEV *DstAccessFn,
+ SmallVectorImpl<const SCEV *> &SrcSubscripts,
+ SmallVectorImpl<const SCEV *> &DstSubscripts);
+
+ /// Tries to delinearize access function for a multi-dimensional array with
+ /// symbolic runtime sizes.
+ /// Returns true upon success and false otherwise.
+ bool tryDelinearizeParametricSize(
+ Instruction *Src, Instruction *Dst, const SCEV *SrcAccessFn,
+ const SCEV *DstAccessFn, SmallVectorImpl<const SCEV *> &SrcSubscripts,
+ SmallVectorImpl<const SCEV *> &DstSubscripts);
+
/// checkSubscript - Helper function for checkSrcSubscript and
/// checkDstSubscript to avoid duplicate code
bool checkSubscript(const SCEV *Expr, const Loop *LoopNest,