0c3dadea75fcae03acac898892901910510ff3ff
[oota-llvm.git] / include / llvm / Analysis / LoopDependenceAnalysis.h
1 //===- llvm/Analysis/LoopDependenceAnalysis.h --------------- -*- 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 // LoopDependenceAnalysis is an LLVM pass that analyses dependences in memory
11 // 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 interface progresses
17 //
18 //===----------------------------------------------------------------------===//
19
20 #ifndef LLVM_ANALYSIS_LOOP_DEPENDENCE_ANALYSIS_H
21 #define LLVM_ANALYSIS_LOOP_DEPENDENCE_ANALYSIS_H
22
23 #include "llvm/Analysis/LoopPass.h"
24 #include "llvm/Support/raw_ostream.h"
25 #include <iosfwd>
26
27 namespace llvm {
28
29   class AnalysisUsage;
30   class ScalarEvolution;
31
32   class LoopDependenceAnalysis : public LoopPass {
33     Loop *L;
34     ScalarEvolution *SE;
35
36   public:
37     static char ID; // Class identification, replacement for typeinfo
38     LoopDependenceAnalysis() : LoopPass(&ID) {}
39
40     bool runOnLoop(Loop*, LPPassManager&);
41
42     virtual void getAnalysisUsage(AnalysisUsage&) const;
43
44     void print(raw_ostream&, const Module* = 0) const;
45     virtual void print(std::ostream&, const Module* = 0) const;
46     void print(std::ostream *OS, const Module *M = 0) const {
47       if (OS) print(*OS, M);
48     }
49   }; // class LoopDependenceAnalysis
50
51
52   // createLoopDependenceAnalysisPass - This creates an instance of the
53   // LoopDependenceAnalysis pass.
54   //
55   LoopPass *createLoopDependenceAnalysisPass();
56
57 } // namespace llvm
58
59 #endif /* LLVM_ANALYSIS_LOOP_DEPENDENCE_ANALYSIS_H */