[PATCH] D36273: [Polly][PM] Register polly passes with the opt tool for the new-pm path

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 09:59:08 PDT 2017


philip.pfaffe created this revision.
Herald added a reviewer: bollu.

When polly is linked into the tools because of the LLVM_POLLY_LINK_INTO_TOOLS option being set, we need to register its passes with the PassBuilder. Because polly is linked in, we can directly call its callback registration method, which registers the appropriate callbacks with the new PM's PassBuilder. This essentially follows exactly the way it worked with the legacy PM.


https://reviews.llvm.org/D36273

Files:
  tools/opt/NewPMDriver.cpp


Index: tools/opt/NewPMDriver.cpp
===================================================================
--- tools/opt/NewPMDriver.cpp
+++ 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 @@
     });
 }
 
+#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 @@
   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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36273.109583.patch
Type: text/x-patch
Size: 1090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170803/fdfcd6b1/attachment.bin>


More information about the llvm-commits mailing list