blob: 172a2be6bcf7cee14a6774673430e3371a035919 [file] [log] [blame]
Andreas Bolka306b5b22009-06-24 21:29:13 +00001//===- LoopDependenceAnalysis.cpp - LDA Implementation ----------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This is the (beginning) of an implementation of a loop dependence analysis
11// framework, which is used to detect dependences in memory accesses in loops.
12//
13// Please note that this is work in progress and the interface is subject to
14// change.
15//
16// TODO: adapt as implementation progresses.
17//
18//===----------------------------------------------------------------------===//
19
20#define DEBUG_TYPE "lda"
21#include "llvm/Analysis/LoopDependenceAnalysis.h"
22#include "llvm/Analysis/LoopPass.h"
23#include "llvm/Analysis/ScalarEvolution.h"
24using namespace llvm;
25
26LoopPass *llvm::createLoopDependenceAnalysisPass() {
27 return new LoopDependenceAnalysis();
28}
29
30static RegisterPass<LoopDependenceAnalysis>
31R("lda", "Loop Dependence Analysis", false, true);
32char LoopDependenceAnalysis::ID = 0;
33
34//===----------------------------------------------------------------------===//
35// LoopDependenceAnalysis Implementation
36//===----------------------------------------------------------------------===//
37
38bool LoopDependenceAnalysis::runOnLoop(Loop *L, LPPassManager &) {
39 this->L = L;
40 SE = &getAnalysis<ScalarEvolution>();
41 return false;
42}
43
44void LoopDependenceAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
45 AU.setPreservesAll();
46 AU.addRequired<ScalarEvolution>();
47}