summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorAndreas Bolka <a@bolka.at>2009-06-24 21:29:13 +0000
committerAndreas Bolka <a@bolka.at>2009-06-24 21:29:13 +0000
commit8c7e299270ad846126836b7229379dbab0d9bedd (patch)
tree728dbb9aa6392d334ccdf0bc8b5595423f2d266d /llvm/lib/Analysis/LoopDependenceAnalysis.cpp
parente3dccb7047c31059c4957975c5711bbc3f321d4a (diff)
downloadbcm5719-llvm-8c7e299270ad846126836b7229379dbab0d9bedd.tar.gz
bcm5719-llvm-8c7e299270ad846126836b7229379dbab0d9bedd.zip
Scaffolding for LDA pass.
llvm-svn: 74120
Diffstat (limited to 'llvm/lib/Analysis/LoopDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopDependenceAnalysis.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopDependenceAnalysis.cpp b/llvm/lib/Analysis/LoopDependenceAnalysis.cpp
new file mode 100644
index 00000000000..172a2be6bcf
--- /dev/null
+++ b/llvm/lib/Analysis/LoopDependenceAnalysis.cpp
@@ -0,0 +1,47 @@
+//===- LoopDependenceAnalysis.cpp - LDA Implementation ----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the (beginning) of an implementation of a loop dependence analysis
+// framework, which is used to detect dependences in memory accesses in loops.
+//
+// Please note that this is work in progress and the interface is subject to
+// change.
+//
+// TODO: adapt as implementation progresses.
+//
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "lda"
+#include "llvm/Analysis/LoopDependenceAnalysis.h"
+#include "llvm/Analysis/LoopPass.h"
+#include "llvm/Analysis/ScalarEvolution.h"
+using namespace llvm;
+
+LoopPass *llvm::createLoopDependenceAnalysisPass() {
+ return new LoopDependenceAnalysis();
+}
+
+static RegisterPass<LoopDependenceAnalysis>
+R("lda", "Loop Dependence Analysis", false, true);
+char LoopDependenceAnalysis::ID = 0;
+
+//===----------------------------------------------------------------------===//
+// LoopDependenceAnalysis Implementation
+//===----------------------------------------------------------------------===//
+
+bool LoopDependenceAnalysis::runOnLoop(Loop *L, LPPassManager &) {
+ this->L = L;
+ SE = &getAnalysis<ScalarEvolution>();
+ return false;
+}
+
+void LoopDependenceAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.setPreservesAll();
+ AU.addRequired<ScalarEvolution>();
+}
OpenPOWER on IntegriCloud