Introduce option to run isl AST generation, but no IR generation.
authorTobias Grosser <tobias@grosser.es>
Fri, 2 Sep 2016 23:05:42 +0000 (23:05 +0000)
committerTobias Grosser <tobias@grosser.es>
Fri, 2 Sep 2016 23:05:42 +0000 (23:05 +0000)
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.

llvm-svn: 280554

polly/lib/Support/RegisterPasses.cpp

index e126159..08edd56 100644 (file)
@@ -79,13 +79,14 @@ static cl::opt<OptimizerChoice> Optimizer(
     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::PassManagerBase &PM) {
     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: