From f692cd303dad2b56215e44f44e47349f30ed7b89 Mon Sep 17 00:00:00 2001 From: Jeff Cohen Date: Sun, 9 Jan 2005 20:42:52 +0000 Subject: [PATCH] Add last four createXxxPass functions llvm-svn: 19424 --- include/llvm/Analysis/Passes.h | 28 +++++++++++++++++++ include/llvm/Transforms/LinkAllPasses.h | 4 +++ .../DataStructure/DataStructureAA.cpp | 3 ++ .../DataStructure/DataStructureOpt.cpp | 3 ++ lib/Analysis/DataStructure/Parallelize.cpp | 3 ++ lib/Analysis/DataStructure/Steensgaard.cpp | 3 ++ 6 files changed, 44 insertions(+) diff --git a/include/llvm/Analysis/Passes.h b/include/llvm/Analysis/Passes.h index 0c991c5aeb1..47e1e72558d 100644 --- a/include/llvm/Analysis/Passes.h +++ b/include/llvm/Analysis/Passes.h @@ -80,6 +80,34 @@ namespace llvm { // createNoProfileInfoPass - This pass implements the default "no profile". // ImmutablePass *createNoProfileInfoPass(); + + //===--------------------------------------------------------------------===// + // + // createDSAAPass - This pass implements simple context sensitive alias + // analysis. + // + ModulePass *createDSAAPass(); + + //===--------------------------------------------------------------------===// + // + // createDSOptPass - This pass uses DSA to do a series of simple + // optimizations. + // + ModulePass *createDSOptPass(); + + //===--------------------------------------------------------------------===// + // + // createParallelizePass - This pass parallelizes a program using the cilk + // multi-threaded runtime system. + // + ModulePass *createParallelizePass(); + + //===--------------------------------------------------------------------===// + // + // createSteensgaardPass - This pass uses the data structure graphs to do a + // simple context insensitive alias analysis. + // + ModulePass *createSteensgaardPass(); } #endif diff --git a/include/llvm/Transforms/LinkAllPasses.h b/include/llvm/Transforms/LinkAllPasses.h index 163de11b4b3..b5d67f73ba5 100644 --- a/include/llvm/Transforms/LinkAllPasses.h +++ b/include/llvm/Transforms/LinkAllPasses.h @@ -56,6 +56,8 @@ namespace { (void) llvm::createConstantMergePass(); (void) llvm::createConstantPropagationPass(); (void) llvm::createCorrelatedExpressionEliminationPass(); + (void) llvm::createDSAAPass(); + (void) llvm::createDSOptPass(); (void) llvm::createDeadArgEliminationPass(); (void) llvm::createDeadCodeEliminationPass(); (void) llvm::createDeadInstEliminationPass(); @@ -95,6 +97,7 @@ namespace { (void) llvm::createNoAAPass(); (void) llvm::createNoProfileInfoPass(); (void) llvm::createPREPass(); + (void) llvm::createParallelizePass(); (void) llvm::createProfilePathsPass(); (void) llvm::createPromoteMemoryToRegister(); (void) llvm::createPruneEHPass(); @@ -104,6 +107,7 @@ namespace { (void) llvm::createSCCPPass(); (void) llvm::createScalarReplAggregatesPass(); (void) llvm::createSingleLoopExtractorPass(); + (void) llvm::createSteensgaardPass(); (void) llvm::createStripSymbolsPass(); (void) llvm::createTailCallEliminationPass(); (void) llvm::createTailDuplicationPass(); diff --git a/lib/Analysis/DataStructure/DataStructureAA.cpp b/lib/Analysis/DataStructure/DataStructureAA.cpp index 9b39c8fcfb0..915909e3a19 100644 --- a/lib/Analysis/DataStructure/DataStructureAA.cpp +++ b/lib/Analysis/DataStructure/DataStructureAA.cpp @@ -14,6 +14,7 @@ #include "llvm/Module.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/Passes.h" #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" using namespace llvm; @@ -71,6 +72,8 @@ namespace { RegisterAnalysisGroup Y; } +ModulePass *llvm::createDSAAPass() { return new DSAA(); } + // getGraphForValue - Return the DSGraph to use for queries about the specified // value... // diff --git a/lib/Analysis/DataStructure/DataStructureOpt.cpp b/lib/Analysis/DataStructure/DataStructureOpt.cpp index 1996aea67d6..1d8373a01df 100644 --- a/lib/Analysis/DataStructure/DataStructureOpt.cpp +++ b/lib/Analysis/DataStructure/DataStructureOpt.cpp @@ -14,6 +14,7 @@ #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" +#include "llvm/Analysis/Passes.h" #include "llvm/Module.h" #include "llvm/Constant.h" #include "llvm/ADT/Statistic.h" @@ -48,6 +49,8 @@ namespace { RegisterOpt X("ds-opt", "DSA-based simple optimizations"); } +ModulePass *llvm::createDSOptPass() { return new DSOpt(); } + /// OptimizeGlobals - This method uses information taken from DSA to optimize /// global variables. /// diff --git a/lib/Analysis/DataStructure/Parallelize.cpp b/lib/Analysis/DataStructure/Parallelize.cpp index 2bb6c7ff46c..a12e323a9b5 100644 --- a/lib/Analysis/DataStructure/Parallelize.cpp +++ b/lib/Analysis/DataStructure/Parallelize.cpp @@ -42,6 +42,7 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "PgmDependenceGraph.h" +#include "llvm/Analysis/Passes.h" #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Support/InstVisitor.h" @@ -408,6 +409,8 @@ namespace { RegisterOpt X("parallel", "Parallelize program using Cilk"); } +ModulePass *llvm::createParallelizePass() { return new Parallelize(); } + bool Parallelize::runOnModule(Module& M) { hash_set parallelFunctions; diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp index b0718a18b97..5102dddec19 100644 --- a/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/lib/Analysis/DataStructure/Steensgaard.cpp @@ -17,6 +17,7 @@ #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/Passes.h" #include "llvm/Module.h" #include "llvm/Support/Debug.h" using namespace llvm; @@ -76,6 +77,8 @@ namespace { RegisterAnalysisGroup Y; } +ModulePass *llvm::createSteensgaardPass() { return new Steens(); } + /// ResolveFunctionCall - Resolve the actual arguments of a call to function F /// with the specified call site descriptor. This function links the arguments /// and the return value for the call site context-insensitively.