[polly] r280554 - Introduce option to run isl AST generation, but no IR generation.

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 16:05:43 PDT 2016


Author: grosser
Date: Fri Sep  2 18:05:42 2016
New Revision: 280554

URL: http://llvm.org/viewvc/llvm-project?rev=280554&view=rev
Log:
Introduce option to run isl AST generation, but no IR generation.

We replace the options

  -polly-code-generator=none
                       =isl

with the options

  -polly-code-generation=none
                        =ast
                        =full

This allows us to measure the overhead of Polly itself, versus the compile
time increases due to us generating more IR and consequently the LLVM backends
spending more time on this IR.

We also use this opportunity to rename the option. The original name was
introduced at a point where we still had two code generators. CLooG and the
isl AST generator. Since we only have one AST generator left, there is no need
to distinguish between 'isl' and something else. However, being able to disable
code generation all together has been shown useful for debugging. Hence, we
rename and extend this option to make it a good fit for its new use case.

Modified:
    polly/trunk/lib/Support/RegisterPasses.cpp

Modified: polly/trunk/lib/Support/RegisterPasses.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/RegisterPasses.cpp?rev=280554&r1=280553&r2=280554&view=diff
==============================================================================
--- polly/trunk/lib/Support/RegisterPasses.cpp (original)
+++ polly/trunk/lib/Support/RegisterPasses.cpp Fri Sep  2 18:05:42 2016
@@ -79,13 +79,14 @@ static cl::opt<OptimizerChoice> Optimize
     cl::Hidden, cl::init(OPTIMIZER_ISL), cl::ZeroOrMore,
     cl::cat(PollyCategory));
 
-enum CodeGenChoice { CODEGEN_ISL, CODEGEN_NONE };
-static cl::opt<CodeGenChoice> CodeGenerator(
-    "polly-code-generator", cl::desc("Select the code generator"),
-    cl::values(clEnumValN(CODEGEN_ISL, "isl", "isl code generator"),
-               clEnumValN(CODEGEN_NONE, "none", "no code generation"),
+enum CodeGenChoice { CODEGEN_FULL, CODEGEN_AST, CODEGEN_NONE };
+static cl::opt<CodeGenChoice> CodeGeneration(
+    "polly-code-generation", cl::desc("How much code-generation to perform"),
+    cl::values(clEnumValN(CODEGEN_FULL, "full", "AST and IR generation"),
+               clEnumValN(CODEGEN_AST, "ast", "Only AST generation"),
+               clEnumValN(CODEGEN_NONE, "none", "No code generation"),
                clEnumValEnd),
-    cl::Hidden, cl::init(CODEGEN_ISL), cl::ZeroOrMore, cl::cat(PollyCategory));
+    cl::Hidden, cl::init(CODEGEN_FULL), cl::ZeroOrMore, cl::cat(PollyCategory));
 
 enum TargetChoice { TARGET_CPU, TARGET_GPU };
 static cl::opt<TargetChoice>
@@ -253,8 +254,11 @@ void registerPollyPasses(llvm::legacy::P
     PM.add(polly::createPPCGCodeGenerationPass());
 #endif
   } else {
-    switch (CodeGenerator) {
-    case CODEGEN_ISL:
+    switch (CodeGeneration) {
+    case CODEGEN_AST:
+      PM.add(polly::createIslAstInfoPass());
+      break;
+    case CODEGEN_FULL:
       PM.add(polly::createCodeGenerationPass());
       break;
     case CODEGEN_NONE:




More information about the llvm-commits mailing list