summaryrefslogtreecommitdiffstats
path: root/polly/lib/RegisterPasses.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2014-01-02 23:39:18 +0000
committerTobias Grosser <tobias@grosser.es>2014-01-02 23:39:18 +0000
commita9376ff571e8dfcd97f909497d929e119ef16787 (patch)
treef6e39a1346578f39fc90ccf1327ec21ca3787f6e /polly/lib/RegisterPasses.cpp
parent3d216a579c72d1b8477e3e6c04d4ab34c53d0684 (diff)
downloadbcm5719-llvm-a9376ff571e8dfcd97f909497d929e119ef16787.tar.gz
bcm5719-llvm-a9376ff571e8dfcd97f909497d929e119ef16787.zip
Introduce -polly-canonicalize pass
This ModulePass schedules the set of Polly canonicalization passes. It is a debugging tool that can be used to preoptimize .ll files for Polly processing. llvm-svn: 198376
Diffstat (limited to 'polly/lib/RegisterPasses.cpp')
-rw-r--r--polly/lib/RegisterPasses.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/polly/lib/RegisterPasses.cpp b/polly/lib/RegisterPasses.cpp
index 03dca9c0d78..5fd1960319b 100644
--- a/polly/lib/RegisterPasses.cpp
+++ b/polly/lib/RegisterPasses.cpp
@@ -20,6 +20,7 @@
//===----------------------------------------------------------------------===//
#include "polly/RegisterPasses.h"
+#include "polly/Canonicalization.h"
#include "polly/CodeGen/BlockGenerators.h"
#include "polly/CodeGen/Cloog.h"
#include "polly/CodeGen/CodeGeneration.h"
@@ -172,6 +173,7 @@ static void initializePollyPasses(PassRegistry &Registry) {
initializePoccPass(Registry);
#endif
initializePollyIndVarSimplifyPass(Registry);
+ initializePollyCanonicalizePass(Registry);
initializeScopDetectionPass(Registry);
initializeScopInfoPass(Registry);
initializeTempScopInfoPass(Registry);
@@ -191,29 +193,6 @@ public:
};
static StaticInitializer InitializeEverything;
-/// @brief Schedule a set of canonicalization passes to prepare for Polly
-///
-/// The set of optimization passes was partially taken/copied from the
-/// set of default optimization passes in LLVM. It is used to bring the code
-/// into a canonical form that simplifies the analysis and optimization passes
-/// of Polly. The set of optimization passes scheduled here is probably not yet
-/// optimal. TODO: Optimize the set of canonicalization passes.
-static void registerCanonicalicationPasses(llvm::PassManagerBase &PM) {
- PM.add(llvm::createPromoteMemoryToRegisterPass());
- PM.add(llvm::createInstructionCombiningPass());
- PM.add(llvm::createCFGSimplificationPass());
- PM.add(llvm::createTailCallEliminationPass());
- PM.add(llvm::createCFGSimplificationPass());
- PM.add(llvm::createReassociatePass());
- PM.add(llvm::createLoopRotatePass());
- PM.add(llvm::createInstructionCombiningPass());
-
- if (!SCEVCodegen)
- PM.add(polly::createIndVarSimplifyPass());
-
- PM.add(polly::createCodePreparationPass());
-}
-
/// @brief Register Polly passes such that they form a polyhedral optimizer.
///
/// The individual Polly passes are registered in the pass manager such that
@@ -245,7 +224,7 @@ static void registerCanonicalicationPasses(llvm::PassManagerBase &PM) {
/// code generator. For the moment, the CLooG code generator is enabled by
/// default.
static void registerPollyPasses(llvm::PassManagerBase &PM) {
- registerCanonicalicationPasses(PM);
+ registerCanonicalicationPasses(PM, SCEVCodegen);
PM.add(polly::createScopInfoPass());
OpenPOWER on IntegriCloud