From 04eaef28a8bc1e530a55c18dab0785f7d1dff640 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 2 Apr 2004 20:56:33 +0000 Subject: Remove obsolete analyses git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12634 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/analyze/AnalysisWrappers.cpp | 72 +------------------------------------- tools/opt/AnalysisWrappers.cpp | 72 +------------------------------------- 2 files changed, 2 insertions(+), 142 deletions(-) diff --git a/tools/analyze/AnalysisWrappers.cpp b/tools/analyze/AnalysisWrappers.cpp index 89945f76ed..aa9f03d883 100644 --- a/tools/analyze/AnalysisWrappers.cpp +++ b/tools/analyze/AnalysisWrappers.cpp @@ -17,14 +17,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/iPHINode.h" -#include "llvm/Type.h" -#include "llvm/Assembly/Writer.h" +#include "llvm/Pass.h" #include "llvm/Analysis/InstForest.h" -#include "llvm/Analysis/Expressions.h" -#include "llvm/Analysis/InductionVariable.h" -#include "llvm/Analysis/LoopInfo.h" -#include "llvm/Support/InstIterator.h" using namespace llvm; @@ -43,68 +37,4 @@ namespace { }; RegisterAnalysis P1("instforest", "InstForest Printer"); - - struct IndVars : public FunctionPass { - Function *F; - LoopInfo *LI; - virtual bool runOnFunction(Function &Func) { - F = &Func; LI = &getAnalysis(); - return false; - } - - void print(std::ostream &OS) const { - for (inst_iterator I = inst_begin(*F), E = inst_end(*F); I != E; ++I) - if (PHINode *PN = dyn_cast(*I)) { - InductionVariable IV(PN, LI); - if (IV.InductionType != InductionVariable::Unknown) - IV.print(OS); - } - } - - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - AU.setPreservesAll(); - } - }; - - RegisterAnalysis P6("indvars", "Induction Variable Analysis"); - - - struct Exprs : public FunctionPass { - Function *F; - virtual bool runOnFunction(Function &Func) { F = &Func; return false; } - - void print(std::ostream &OS) const { - OS << "Classified expressions for: " << F->getName() << "\n"; - for (inst_iterator I = inst_begin(*F), E = inst_end(*F); I != E; ++I) { - OS << *I; - - if ((*I)->getType() == Type::VoidTy) continue; - ExprType R = ClassifyExpr(*I); - if (R.Var == *I) continue; // Doesn't tell us anything - - OS << "\t\tExpr ="; - switch (R.ExprTy) { - case ExprType::ScaledLinear: - WriteAsOperand(OS << "(", (Value*)R.Scale) << " ) *"; - // fall through - case ExprType::Linear: - WriteAsOperand(OS << "(", R.Var) << " )"; - if (R.Offset == 0) break; - else OS << " +"; - // fall through - case ExprType::Constant: - if (R.Offset) WriteAsOperand(OS, (Value*)R.Offset); - else OS << " 0"; - break; - } - OS << "\n\n"; - } - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - } - }; - - RegisterAnalysis P7("exprs", "Expression Printer"); } diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index 89945f76ed..aa9f03d883 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -17,14 +17,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/iPHINode.h" -#include "llvm/Type.h" -#include "llvm/Assembly/Writer.h" +#include "llvm/Pass.h" #include "llvm/Analysis/InstForest.h" -#include "llvm/Analysis/Expressions.h" -#include "llvm/Analysis/InductionVariable.h" -#include "llvm/Analysis/LoopInfo.h" -#include "llvm/Support/InstIterator.h" using namespace llvm; @@ -43,68 +37,4 @@ namespace { }; RegisterAnalysis P1("instforest", "InstForest Printer"); - - struct IndVars : public FunctionPass { - Function *F; - LoopInfo *LI; - virtual bool runOnFunction(Function &Func) { - F = &Func; LI = &getAnalysis(); - return false; - } - - void print(std::ostream &OS) const { - for (inst_iterator I = inst_begin(*F), E = inst_end(*F); I != E; ++I) - if (PHINode *PN = dyn_cast(*I)) { - InductionVariable IV(PN, LI); - if (IV.InductionType != InductionVariable::Unknown) - IV.print(OS); - } - } - - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - AU.setPreservesAll(); - } - }; - - RegisterAnalysis P6("indvars", "Induction Variable Analysis"); - - - struct Exprs : public FunctionPass { - Function *F; - virtual bool runOnFunction(Function &Func) { F = &Func; return false; } - - void print(std::ostream &OS) const { - OS << "Classified expressions for: " << F->getName() << "\n"; - for (inst_iterator I = inst_begin(*F), E = inst_end(*F); I != E; ++I) { - OS << *I; - - if ((*I)->getType() == Type::VoidTy) continue; - ExprType R = ClassifyExpr(*I); - if (R.Var == *I) continue; // Doesn't tell us anything - - OS << "\t\tExpr ="; - switch (R.ExprTy) { - case ExprType::ScaledLinear: - WriteAsOperand(OS << "(", (Value*)R.Scale) << " ) *"; - // fall through - case ExprType::Linear: - WriteAsOperand(OS << "(", R.Var) << " )"; - if (R.Offset == 0) break; - else OS << " +"; - // fall through - case ExprType::Constant: - if (R.Offset) WriteAsOperand(OS, (Value*)R.Offset); - else OS << " 0"; - break; - } - OS << "\n\n"; - } - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - } - }; - - RegisterAnalysis P7("exprs", "Expression Printer"); } -- cgit v1.2.3