[llvm-commits] [polly] r144638 - in /polly/trunk: include/polly/LinkAllPasses.h lib/Exchange/JSONExporter.cpp lib/RegisterPasses.cpp www/example_load_Polly_into_clang.html

Tobias Grosser grosser at fim.uni-passau.de
Tue Nov 15 03:38:37 PST 2011


Author: grosser
Date: Tue Nov 15 05:38:36 2011
New Revision: 144638

URL: http://llvm.org/viewvc/llvm-project?rev=144638&view=rev
Log:
Make JScop export/reimport accessible from clang

Modified:
    polly/trunk/include/polly/LinkAllPasses.h
    polly/trunk/lib/Exchange/JSONExporter.cpp
    polly/trunk/lib/RegisterPasses.cpp
    polly/trunk/www/example_load_Polly_into_clang.html

Modified: polly/trunk/include/polly/LinkAllPasses.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/LinkAllPasses.h?rev=144638&r1=144637&r2=144638&view=diff
==============================================================================
--- polly/trunk/include/polly/LinkAllPasses.h (original)
+++ polly/trunk/include/polly/LinkAllPasses.h Tue Nov 15 05:38:36 2011
@@ -112,6 +112,8 @@
   void initializeCodeGenerationPass(llvm::PassRegistry&);
   void initializeCodePreparationPass(llvm::PassRegistry&);
   void initializeIndependentBlocksPass(llvm::PassRegistry&);
+  void initializeJSONExporterPass(llvm::PassRegistry&);
+  void initializeJSONImporterPass(llvm::PassRegistry&);
   void initializeIslScheduleOptimizerPass(llvm::PassRegistry&);
 #ifdef SCOPLIB_FOUND
   void initializePoccPass(llvm::PassRegistry&);

Modified: polly/trunk/lib/Exchange/JSONExporter.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=144638&r1=144637&r2=144638&view=diff
==============================================================================
--- polly/trunk/lib/Exchange/JSONExporter.cpp (original)
+++ polly/trunk/lib/Exchange/JSONExporter.cpp Tue Nov 15 05:38:36 2011
@@ -167,10 +167,13 @@
   AU.addRequired<ScopInfo>();
 }
 
-static RegisterPass<JSONExporter> A("polly-export-jscop",
-                                    "Polly - Export Scops as JSON"
-                                    " (Writes a .jscop file for each Scop)"
-                                    );
+INITIALIZE_PASS_BEGIN(JSONExporter, "polly-export-jscop",
+                      "Polly - Export Scops as JSON"
+                      " (Writes a .jscop file for each Scop)", false, false)
+INITIALIZE_PASS_DEPENDENCY(Dependences)
+INITIALIZE_PASS_END(JSONExporter, "polly-export-jscop",
+                    "Polly - Export Scops as JSON"
+                    " (Writes a .jscop file for each Scop)", false, false)
 
 Pass *polly::createJSONExporterPass() {
   return new JSONExporter();
@@ -304,10 +307,13 @@
   AU.addRequired<Dependences>();
 }
 
-static RegisterPass<JSONImporter> B("polly-import-jscop",
-                                    "Polly - Import Scops from JSON"
-                                    " (Reads a .jscop file for each Scop)"
-                                    );
+INITIALIZE_PASS_BEGIN(JSONImporter, "polly-import-jscop",
+                      "Polly - Import Scops from JSON"
+                      " (Reads a .jscop file for each Scop)", false, false)
+INITIALIZE_PASS_DEPENDENCY(Dependences)
+INITIALIZE_PASS_END(JSONImporter, "polly-import-jscop",
+                    "Polly - Import Scops from JSON"
+                    " (Reads a .jscop file for each Scop)", false, false)
 
 Pass *polly::createJSONImporterPass() {
   return new JSONImporter();

Modified: polly/trunk/lib/RegisterPasses.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/RegisterPasses.cpp?rev=144638&r1=144637&r2=144638&view=diff
==============================================================================
--- polly/trunk/lib/RegisterPasses.cpp (original)
+++ polly/trunk/lib/RegisterPasses.cpp Tue Nov 15 05:38:36 2011
@@ -41,6 +41,14 @@
        cl::desc("Use the PoCC optimizer instead of the one in isl"), cl::Hidden,
        cl::init(false));
 static cl::opt<bool>
+ImportJScop("polly-run-import-jscop",
+            cl::desc("Export the JScop description of the detected Scops"),
+            cl::Hidden, cl::init(false));
+static cl::opt<bool>
+ExportJScop("polly-run-export-jscop",
+            cl::desc("Export the JScop description of the detected Scops"),
+            cl::Hidden, cl::init(false));
+static cl::opt<bool>
 PollyViewer("polly-show",
        cl::desc("Enable the Polly DOT viewer in -O3"), cl::Hidden,
        cl::value_desc("Run the Polly DOT viewer at -O3"),
@@ -69,6 +77,8 @@
   initializeCodePreparationPass(Registry);
   initializeDependencesPass(Registry);
   initializeIndependentBlocksPass(Registry);
+  initializeJSONExporterPass(Registry);
+  initializeJSONImporterPass(Registry);
   initializeIslScheduleOptimizerPass(Registry);
 #ifdef SCOPLIB_FOUND
   initializePoccPass(Registry);
@@ -137,6 +147,9 @@
   if (PollyOnlyPrinter)
     PM.add(polly::createDOTOnlyPrinterPass());
 
+  if (ImportJScop)
+    PM.add(polly::createJSONImporterPass());
+
   if (!DisableScheduler) {
     if (!UsePocc)
       PM.add(polly::createIslScheduleOptimizerPass());
@@ -150,9 +163,12 @@
       PM.add(polly::createIslScheduleOptimizerPass());
 #endif
     }
-
   }
 
+  if (ExportJScop)
+    PM.add(polly::createJSONExporterPass());
+
+
   if (!DisableCodegen)
     PM.add(polly::createCodeGenerationPass());
 }

Modified: polly/trunk/www/example_load_Polly_into_clang.html
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/www/example_load_Polly_into_clang.html?rev=144638&r1=144637&r2=144638&view=diff
==============================================================================
--- polly/trunk/www/example_load_Polly_into_clang.html (original)
+++ polly/trunk/www/example_load_Polly_into_clang.html Tue Nov 15 05:38:36 2011
@@ -99,6 +99,11 @@
 no aliasing is possible. In case the user knows no aliasing can happen in the
 code the <b>-polly-ignore-aliasing</b> can be used to disable the check for
 possible aliasing.
+
+<h3>Importing and exporting JScop files</h3>
+The flags <b>-polly-run-import-jscop</b> and <b>-polly-run-export-jscop</b>
+allow the export and reimport of the polyhedral representation that Polly
+generates for the Scops.
 </div>
 </body>
 </html>





More information about the llvm-commits mailing list