summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/opt/NewPMDriver.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 32f71a5beda..f46d37ee8c7 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/tools/opt/NewPMDriver.cpp
@@ -18,6 +18,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/CGSCCPassManager.h"
#include "llvm/Bitcode/BitcodeWriterPass.h"
+#include "llvm/Config/config.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/LLVMContext.h"
@@ -160,6 +161,12 @@ static void registerEPCallbacks(PassBuilder &PB, bool VerifyEachPass,
});
}
+#ifdef LINK_POLLY_INTO_TOOLS
+namespace polly {
+void RegisterPollyPasses(PassBuilder &);
+}
+#endif
+
bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
tool_output_file *Out,
tool_output_file *ThinLTOLinkOut,
@@ -190,6 +197,10 @@ bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
PassBuilder PB(TM, P);
registerEPCallbacks(PB, VerifyEachPass, DebugPM);
+#ifdef LINK_POLLY_INTO_TOOLS
+ polly::RegisterPollyPasses(PB);
+#endif
+
// Specially handle the alias analysis manager so that we can register
// a custom pipeline of AA passes with it.
AAManager AA;
OpenPOWER on IntegriCloud