From f17ab7f1e47fc16d61cca0ef423138bea314772d Mon Sep 17 00:00:00 2001 From: Andreas Bolka Date: Sun, 28 Jun 2009 00:21:21 +0000 Subject: Minimal LDA interface, maximally conservative tester. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74401 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/LoopDependenceAnalysis.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/Analysis') diff --git a/lib/Analysis/LoopDependenceAnalysis.cpp b/lib/Analysis/LoopDependenceAnalysis.cpp index 8f3e6ba..b23459e 100644 --- a/lib/Analysis/LoopDependenceAnalysis.cpp +++ b/lib/Analysis/LoopDependenceAnalysis.cpp @@ -21,6 +21,7 @@ #include "llvm/Analysis/LoopDependenceAnalysis.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/ScalarEvolution.h" +#include "llvm/Instructions.h" using namespace llvm; LoopPass *llvm::createLoopDependenceAnalysisPass() { @@ -32,6 +33,29 @@ R("lda", "Loop Dependence Analysis", false, true); char LoopDependenceAnalysis::ID = 0; //===----------------------------------------------------------------------===// +// Utility Functions +//===----------------------------------------------------------------------===// + +static inline bool isMemRefInstr(const Value *I) { + return isa(I) || isa(I); +} + +//===----------------------------------------------------------------------===// +// Dependence Testing +//===----------------------------------------------------------------------===// + +bool LoopDependenceAnalysis::isDependencePair(const Value *x, + const Value *y) const { + return isMemRefInstr(x) && isMemRefInstr(y) + && (isa(x) || isa(y)); +} + +bool LoopDependenceAnalysis::depends(Value *src, Value *dst) { + assert(isDependencePair(src, dst) && "Values form no dependence pair!"); + return true; +} + +//===----------------------------------------------------------------------===// // LoopDependenceAnalysis Implementation //===----------------------------------------------------------------------===// -- cgit v1.1