[llvm-commits] [llvm] r74400 - in /llvm/trunk: include/llvm/Analysis/LoopDependenceAnalysis.h lib/Analysis/LoopDependenceAnalysis.cpp
Andreas Bolka
a at bolka.at
Sat Jun 27 17:16:08 PDT 2009
Author: abolka
Date: Sat Jun 27 19:16:08 2009
New Revision: 74400
URL: http://llvm.org/viewvc/llvm-project?rev=74400&view=rev
Log:
LDA analysis output scaffolding.
Modified:
llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h
llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h?rev=74400&r1=74399&r2=74400&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h Sat Jun 27 19:16:08 2009
@@ -21,11 +21,12 @@
#define LLVM_ANALYSIS_LOOP_DEPENDENCE_ANALYSIS_H
#include "llvm/Analysis/LoopPass.h"
+#include "llvm/Support/raw_ostream.h"
+#include <iosfwd>
namespace llvm {
class AnalysisUsage;
- class LoopPass;
class ScalarEvolution;
class LoopDependenceAnalysis : public LoopPass {
@@ -39,6 +40,12 @@
bool runOnLoop(Loop*, LPPassManager&);
virtual void getAnalysisUsage(AnalysisUsage&) const;
+
+ void print(raw_ostream&, const Module* = 0) const;
+ virtual void print(std::ostream&, const Module* = 0) const;
+ void print(std::ostream *OS, const Module *M = 0) const {
+ if (OS) print(*OS, M);
+ }
}; // class LoopDependenceAnalysis
Modified: llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp?rev=74400&r1=74399&r2=74400&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp Sat Jun 27 19:16:08 2009
@@ -43,5 +43,23 @@
void LoopDependenceAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
- AU.addRequired<ScalarEvolution>();
+ AU.addRequiredTransitive<ScalarEvolution>();
+}
+
+static void PrintLoopInfo(
+ raw_ostream &OS, const LoopDependenceAnalysis *LDA, const Loop *L) {
+ if (!L->empty()) return; // ignore non-innermost loops
+
+ OS << "Loop at depth " << L->getLoopDepth() << ", header block: ";
+ WriteAsOperand(OS, L->getHeader(), false);
+ OS << "\n";
+}
+
+void LoopDependenceAnalysis::print(raw_ostream &OS, const Module*) const {
+ PrintLoopInfo(OS, this, this->L);
+}
+
+void LoopDependenceAnalysis::print(std::ostream &OS, const Module *M) const {
+ raw_os_ostream os(OS);
+ print(os, M);
}
More information about the llvm-commits
mailing list