Polly  16.0.0git
RegisterPasses.cpp
Go to the documentation of this file.
1 //===------ RegisterPasses.cpp - Add the Polly Passes to default passes --===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file composes the individual LLVM-IR passes provided by Polly to a
10 // functional polyhedral optimizer. The polyhedral optimizer is automatically
11 // made available to LLVM based compilers by loading the Polly shared library
12 // into such a compiler.
13 //
14 // The Polly optimizer is made available by executing a static constructor that
15 // registers the individual Polly passes in the LLVM pass manager builder. The
16 // passes are registered such that the default behaviour of the compiler is not
17 // changed, but that the flag '-polly' provided at optimization level '-O3'
18 // enables additional polyhedral optimizations.
19 //===----------------------------------------------------------------------===//
20 
21 #include "polly/RegisterPasses.h"
22 #include "polly/Canonicalization.h"
25 #include "polly/CodeGen/IslAst.h"
26 #include "polly/CodePreparation.h"
27 #include "polly/DeLICM.h"
29 #include "polly/DependenceInfo.h"
30 #include "polly/ForwardOpTree.h"
31 #include "polly/JSONExporter.h"
32 #include "polly/LinkAllPasses.h"
34 #include "polly/PolyhedralInfo.h"
37 #include "polly/ScopDetection.h"
38 #include "polly/ScopGraphPrinter.h"
39 #include "polly/ScopInfo.h"
40 #include "polly/Simplify.h"
43 #include "llvm/Analysis/CFGPrinter.h"
44 #include "llvm/IR/LegacyPassManager.h"
45 #include "llvm/IR/PassManager.h"
46 #include "llvm/IR/Verifier.h"
47 #include "llvm/Passes/PassBuilder.h"
48 #include "llvm/Passes/PassPlugin.h"
49 #include "llvm/Support/CommandLine.h"
50 #include "llvm/Support/TargetSelect.h"
51 #include "llvm/Transforms/IPO.h"
52 #include "llvm/Transforms/IPO/PassManagerBuilder.h"
53 
54 namespace cl = llvm::cl;
55 
56 using llvm::FunctionPassManager;
57 using llvm::OptimizationLevel;
58 using llvm::PassBuilder;
59 using llvm::PassInstrumentationCallbacks;
60 
61 cl::OptionCategory PollyCategory("Polly Options",
62  "Configure the polly loop optimizer");
63 
64 namespace polly {
65 static cl::opt<bool>
66  PollyEnabled("polly",
67  cl::desc("Enable the polly optimizer (with -O1, -O2 or -O3)"),
68  cl::cat(PollyCategory));
69 
70 static cl::opt<bool> PollyDetectOnly(
71  "polly-only-scop-detection",
72  cl::desc("Only run scop detection, but no other optimizations"),
73  cl::cat(PollyCategory));
74 
79 };
80 
82 
83 static cl::opt<PassPositionChoice> PassPosition(
84  "polly-position", cl::desc("Where to run polly in the pass pipeline"),
85  cl::values(
86  clEnumValN(POSITION_EARLY, "early", "Before everything"),
87  clEnumValN(POSITION_AFTER_LOOPOPT, "after-loopopt",
88  "After the loop optimizer (but within the inline cycle)"),
89  clEnumValN(POSITION_BEFORE_VECTORIZER, "before-vectorizer",
90  "Right before the vectorizer")),
91  cl::Hidden, cl::init(POSITION_BEFORE_VECTORIZER), cl::cat(PollyCategory));
92 
93 static cl::opt<OptimizerChoice>
94  Optimizer("polly-optimizer", cl::desc("Select the scheduling optimizer"),
95  cl::values(clEnumValN(OPTIMIZER_NONE, "none", "No optimizer"),
96  clEnumValN(OPTIMIZER_ISL, "isl",
97  "The isl scheduling optimizer")),
98  cl::Hidden, cl::init(OPTIMIZER_ISL), cl::cat(PollyCategory));
99 
101 static cl::opt<CodeGenChoice> CodeGeneration(
102  "polly-code-generation", cl::desc("How much code-generation to perform"),
103  cl::values(clEnumValN(CODEGEN_FULL, "full", "AST and IR generation"),
104  clEnumValN(CODEGEN_AST, "ast", "Only AST generation"),
105  clEnumValN(CODEGEN_NONE, "none", "No code generation")),
106  cl::Hidden, cl::init(CODEGEN_FULL), cl::cat(PollyCategory));
107 
109 static cl::opt<TargetChoice>
110  Target("polly-target", cl::desc("The hardware to target"),
111  cl::values(clEnumValN(TARGET_CPU, "cpu", "generate CPU code")
112 #ifdef GPU_CODEGEN
113  ,
114  clEnumValN(TARGET_GPU, "gpu", "generate GPU code"),
115  clEnumValN(TARGET_HYBRID, "hybrid",
116  "generate GPU code (preferably) or CPU code")
117 #endif
118  ),
119  cl::init(TARGET_CPU), cl::cat(PollyCategory));
120 
122 
123 static cl::opt<VectorizerChoice, true> Vectorizer(
124  "polly-vectorizer", cl::desc("Select the vectorization strategy"),
125  cl::values(
126  clEnumValN(VECTORIZER_NONE, "none", "No Vectorization"),
127  clEnumValN(VECTORIZER_POLLY, "polly", "Polly internal vectorizer"),
128  clEnumValN(
129  VECTORIZER_STRIPMINE, "stripmine",
130  "Strip-mine outer loops for the loop-vectorizer to trigger")),
132  cl::cat(PollyCategory));
133 
134 static cl::opt<bool> ImportJScop(
135  "polly-import",
136  cl::desc("Import the polyhedral description of the detected Scops"),
137  cl::Hidden, cl::cat(PollyCategory));
138 
139 static cl::opt<bool> FullyIndexedStaticExpansion(
140  "polly-enable-mse",
141  cl::desc("Fully expand the memory accesses of the detected Scops"),
142  cl::Hidden, cl::cat(PollyCategory));
143 
144 static cl::opt<bool> ExportJScop(
145  "polly-export",
146  cl::desc("Export the polyhedral description of the detected Scops"),
147  cl::Hidden, cl::cat(PollyCategory));
148 
149 static cl::opt<bool> DeadCodeElim("polly-run-dce",
150  cl::desc("Run the dead code elimination"),
151  cl::Hidden, cl::cat(PollyCategory));
152 
153 static cl::opt<bool> PollyViewer(
154  "polly-show",
155  cl::desc("Highlight the code regions that will be optimized in a "
156  "(CFG BBs and LLVM-IR instructions)"),
157  cl::cat(PollyCategory));
158 
159 static cl::opt<bool> PollyOnlyViewer(
160  "polly-show-only",
161  cl::desc("Highlight the code regions that will be optimized in "
162  "a (CFG only BBs)"),
163  cl::init(false), cl::cat(PollyCategory));
164 
165 static cl::opt<bool>
166  PollyPrinter("polly-dot", cl::desc("Enable the Polly DOT printer in -O3"),
167  cl::Hidden, cl::value_desc("Run the Polly DOT printer at -O3"),
168  cl::init(false), cl::cat(PollyCategory));
169 
170 static cl::opt<bool> PollyOnlyPrinter(
171  "polly-dot-only",
172  cl::desc("Enable the Polly DOT printer in -O3 (no BB content)"), cl::Hidden,
173  cl::value_desc("Run the Polly DOT printer at -O3 (no BB content"),
174  cl::init(false), cl::cat(PollyCategory));
175 
176 static cl::opt<bool>
177  CFGPrinter("polly-view-cfg",
178  cl::desc("Show the Polly CFG right after code generation"),
179  cl::Hidden, cl::init(false), cl::cat(PollyCategory));
180 
181 static cl::opt<bool>
182  EnablePolyhedralInfo("polly-enable-polyhedralinfo",
183  cl::desc("Enable polyhedral interface of Polly"),
184  cl::Hidden, cl::init(false), cl::cat(PollyCategory));
185 
186 static cl::opt<bool>
187  EnableForwardOpTree("polly-enable-optree",
188  cl::desc("Enable operand tree forwarding"), cl::Hidden,
189  cl::init(true), cl::cat(PollyCategory));
190 
191 static cl::opt<bool>
192  DumpBefore("polly-dump-before",
193  cl::desc("Dump module before Polly transformations into a file "
194  "suffixed with \"-before\""),
195  cl::init(false), cl::cat(PollyCategory));
196 
197 static cl::list<std::string> DumpBeforeFile(
198  "polly-dump-before-file",
199  cl::desc("Dump module before Polly transformations to the given file"),
200  cl::cat(PollyCategory));
201 
202 static cl::opt<bool>
203  DumpAfter("polly-dump-after",
204  cl::desc("Dump module after Polly transformations into a file "
205  "suffixed with \"-after\""),
206  cl::init(false), cl::cat(PollyCategory));
207 
208 static cl::list<std::string> DumpAfterFile(
209  "polly-dump-after-file",
210  cl::desc("Dump module after Polly transformations to the given file"),
211  cl::cat(PollyCategory));
212 
213 static cl::opt<bool>
214  EnableDeLICM("polly-enable-delicm",
215  cl::desc("Eliminate scalar loop carried dependences"),
216  cl::Hidden, cl::init(true), cl::cat(PollyCategory));
217 
218 static cl::opt<bool>
219  EnableSimplify("polly-enable-simplify",
220  cl::desc("Simplify SCoP after optimizations"),
221  cl::init(true), cl::cat(PollyCategory));
222 
223 static cl::opt<bool> EnablePruneUnprofitable(
224  "polly-enable-prune-unprofitable",
225  cl::desc("Bail out on unprofitable SCoPs before rescheduling"), cl::Hidden,
226  cl::init(true), cl::cat(PollyCategory));
227 
228 namespace {
229 
230 /// Initialize Polly passes when library is loaded.
231 ///
232 /// We use the constructor of a statically declared object to initialize the
233 /// different Polly passes right after the Polly library is loaded. This ensures
234 /// that the Polly passes are available e.g. in the 'opt' tool.
235 struct StaticInitializer {
236  StaticInitializer() {
237  llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry();
239  }
240 };
241 static StaticInitializer InitializeEverything;
242 } // end of anonymous namespace.
243 
244 void initializePollyPasses(llvm::PassRegistry &Registry) {
246 
247 #ifdef GPU_CODEGEN
248  initializePPCGCodeGenerationPass(Registry);
249  initializeManagedMemoryRewritePassPass(Registry);
250  LLVMInitializeNVPTXTarget();
251  LLVMInitializeNVPTXTargetInfo();
252  LLVMInitializeNVPTXTargetMC();
253  LLVMInitializeNVPTXAsmPrinter();
254 #endif
261  initializeJSONExporterPass(Registry);
262  initializeJSONImporterPass(Registry);
274  initializeScopInlinerPass(Registry);
290 }
291 
292 /// Register Polly passes such that they form a polyhedral optimizer.
293 ///
294 /// The individual Polly passes are registered in the pass manager such that
295 /// they form a full polyhedral optimizer. The flow of the optimizer starts with
296 /// a set of preparing transformations that canonicalize the LLVM-IR such that
297 /// the LLVM-IR is easier for us to understand and to optimizes. On the
298 /// canonicalized LLVM-IR we first run the ScopDetection pass, which detects
299 /// static control flow regions. Those regions are then translated by the
300 /// ScopInfo pass into a polyhedral representation. As a next step, a scheduling
301 /// optimizer is run on the polyhedral representation and finally the optimized
302 /// polyhedral representation is code generated back to LLVM-IR.
303 ///
304 /// Besides this core functionality, we optionally schedule passes that provide
305 /// a graphical view of the scops (Polly[Only]Viewer, Polly[Only]Printer), that
306 /// allow the export/import of the polyhedral representation
307 /// (JSCON[Exporter|Importer]) or that show the cfg after code generation.
308 ///
309 /// For certain parts of the Polly optimizer, several alternatives are provided:
310 ///
311 /// As scheduling optimizer we support the isl scheduling optimizer
312 /// (http://freecode.com/projects/isl).
313 /// It is also possible to run Polly with no optimizer. This mode is mainly
314 /// provided to analyze the run and compile time changes caused by the
315 /// scheduling optimizer.
316 ///
317 /// Polly supports the isl internal code generator.
318 static void registerPollyPasses(llvm::legacy::PassManagerBase &PM,
319  bool EnableForOpt) {
320  if (DumpBefore)
321  PM.add(polly::createDumpModuleWrapperPass("-before", true));
322  for (auto &Filename : DumpBeforeFile)
323  PM.add(polly::createDumpModuleWrapperPass(Filename, false));
324 
327 
328  if (PollyDetectOnly)
329  return;
330 
331  if (PollyViewer)
333  if (PollyOnlyViewer)
335  if (PollyPrinter)
337  if (PollyOnlyPrinter)
342 
343  if (EnableSimplify)
347  if (EnableDeLICM)
349  if (EnableSimplify)
351 
352  if (ImportJScop)
354 
355  if (DeadCodeElim)
357 
360 
363 
364 #ifdef GPU_CODEGEN
365  if (Target == TARGET_HYBRID)
366  PM.add(
367  polly::createPPCGCodeGenerationPass(GPUArchChoice, GPURuntimeChoice));
368 #endif
369  if (Target == TARGET_CPU || Target == TARGET_HYBRID)
370  switch (Optimizer) {
371  case OPTIMIZER_NONE:
372  break; /* Do nothing */
373 
374  case OPTIMIZER_ISL:
376  break;
377  }
378 
379  if (ExportJScop)
381 
382  if (!EnableForOpt)
383  return;
384 
385  if (Target == TARGET_CPU || Target == TARGET_HYBRID)
386  switch (CodeGeneration) {
387  case CODEGEN_AST:
389  break;
390  case CODEGEN_FULL:
392  break;
393  case CODEGEN_NONE:
394  break;
395  }
396 #ifdef GPU_CODEGEN
397  else {
398  PM.add(
399  polly::createPPCGCodeGenerationPass(GPUArchChoice, GPURuntimeChoice));
400  PM.add(polly::createManagedMemoryRewritePassPass());
401  }
402 #endif
403 
404 #ifdef GPU_CODEGEN
405  if (Target == TARGET_HYBRID)
406  PM.add(polly::createManagedMemoryRewritePassPass(GPUArchChoice,
408 #endif
409 
410  // FIXME: This dummy ModulePass keeps some programs from miscompiling,
411  // probably some not correctly preserved analyses. It acts as a barrier to
412  // force all analysis results to be recomputed.
413  PM.add(llvm::createBarrierNoopPass());
414 
415  if (DumpAfter)
416  PM.add(polly::createDumpModuleWrapperPass("-after", true));
417  for (auto &Filename : DumpAfterFile)
418  PM.add(polly::createDumpModuleWrapperPass(Filename, false));
419 
420  if (CFGPrinter)
421  PM.add(llvm::createCFGPrinterLegacyPassPass());
422 }
423 
425 
427  // FIXME: PollyTrackFailures is user-controlled, should not be set
428  // programmatically.
430  PollyTrackFailures = true;
431 
433  ExportJScop;
434 }
435 
436 static void
437 registerPollyEarlyAsPossiblePasses(const llvm::PassManagerBuilder &Builder,
438  llvm::legacy::PassManagerBase &PM) {
440  return;
441 
442  bool EnableForOpt = shouldEnablePollyForOptimization() &&
443  Builder.OptLevel >= 1 && Builder.SizeLevel == 0;
444  if (!shouldEnablePollyForDiagnostic() && !EnableForOpt)
445  return;
446 
448  registerPollyPasses(PM, EnableForOpt);
449 }
450 
451 static void
452 registerPollyLoopOptimizerEndPasses(const llvm::PassManagerBuilder &Builder,
453  llvm::legacy::PassManagerBase &PM) {
455  return;
456 
457  bool EnableForOpt = shouldEnablePollyForOptimization() &&
458  Builder.OptLevel >= 1 && Builder.SizeLevel == 0;
459  if (!shouldEnablePollyForDiagnostic() && !EnableForOpt)
460  return;
461 
462  registerPollyPasses(PM, EnableForOpt);
463  if (EnableForOpt)
464  PM.add(createCodegenCleanupPass());
465 }
466 
467 static void
468 registerPollyScalarOptimizerLatePasses(const llvm::PassManagerBuilder &Builder,
469  llvm::legacy::PassManagerBase &PM) {
471  return;
472 
473  bool EnableForOpt = shouldEnablePollyForOptimization() &&
474  Builder.OptLevel >= 1 && Builder.SizeLevel == 0;
475  if (!shouldEnablePollyForDiagnostic() && !EnableForOpt)
476  return;
477 
478  polly::registerPollyPasses(PM, EnableForOpt);
479  if (EnableForOpt)
480  PM.add(createCodegenCleanupPass());
481 }
482 
483 /// Add the pass sequence required for Polly to the New Pass Manager.
484 ///
485 /// @param PM The pass manager itself.
486 /// @param Level The optimization level. Used for the cleanup of Polly's
487 /// output.
488 /// @param EnableForOpt Whether to add Polly IR transformations. If False, only
489 /// the analysis passes are added, skipping Polly itself.
490 /// The IR may still be modified.
491 static void buildCommonPollyPipeline(FunctionPassManager &PM,
492  OptimizationLevel Level,
493  bool EnableForOpt) {
494  PassBuilder PB;
495  ScopPassManager SPM;
496 
497  PM.addPass(CodePreparationPass());
498 
499  // TODO add utility passes for the various command line options, once they're
500  // ported
501 
502  if (PollyDetectOnly) {
503  // Don't add more passes other than the ScopPassManager's detection passes.
504  PM.addPass(createFunctionToScopPassAdaptor(std::move(SPM)));
505  return;
506  }
507 
508  if (PollyViewer)
509  PM.addPass(ScopViewer());
510  if (PollyOnlyViewer)
511  PM.addPass(ScopOnlyViewer());
512  if (PollyPrinter)
513  PM.addPass(ScopPrinter());
514  if (PollyOnlyPrinter)
515  PM.addPass(ScopOnlyPrinter());
517  llvm::report_fatal_error(
518  "Option -polly-enable-polyhedralinfo not supported with NPM", false);
519 
520  if (EnableSimplify)
521  SPM.addPass(SimplifyPass(0));
523  SPM.addPass(ForwardOpTreePass());
524  if (EnableDeLICM)
525  SPM.addPass(DeLICMPass());
526  if (EnableSimplify)
527  SPM.addPass(SimplifyPass(1));
528 
529  if (ImportJScop)
530  SPM.addPass(JSONImportPass());
531 
532  if (DeadCodeElim)
533  SPM.addPass(DeadCodeElimPass());
534 
536  llvm::report_fatal_error("Option -polly-enable-mse not supported with NPM",
537  false);
538 
540  SPM.addPass(PruneUnprofitablePass());
541 
542  if (Target == TARGET_CPU || Target == TARGET_HYBRID) {
543  switch (Optimizer) {
544  case OPTIMIZER_NONE:
545  break; /* Do nothing */
546  case OPTIMIZER_ISL:
547  SPM.addPass(IslScheduleOptimizerPass());
548  break;
549  }
550  }
551 
552  if (ExportJScop)
553  llvm::report_fatal_error("Option -polly-export not supported with NPM",
554  false);
555 
556  if (!EnableForOpt)
557  return;
558 
559  if (Target == TARGET_CPU || Target == TARGET_HYBRID) {
560  switch (CodeGeneration) {
561  case CODEGEN_AST:
562  SPM.addPass(
563  llvm::RequireAnalysisPass<IslAstAnalysis, Scop, ScopAnalysisManager,
565  SPMUpdater &>());
566  break;
567  case CODEGEN_FULL:
568  SPM.addPass(CodeGenerationPass());
569  break;
570  case CODEGEN_NONE:
571  break;
572  }
573  }
574 #ifdef GPU_CODEGEN
575  else
576  llvm::report_fatal_error("Option -polly-target=gpu not supported for NPM",
577  false);
578 #endif
579 
580 #ifdef GPU_CODEGEN
581  if (Target == TARGET_HYBRID)
582  llvm::report_fatal_error(
583  "Option -polly-target=hybrid not supported for NPM", false);
584 #endif
585 
586  PM.addPass(createFunctionToScopPassAdaptor(std::move(SPM)));
587  PM.addPass(PB.buildFunctionSimplificationPipeline(
588  Level, llvm::ThinOrFullLTOPhase::None)); // Cleanup
589 
590  if (CFGPrinter)
591  PM.addPass(llvm::CFGPrinterPass());
592 }
593 
594 static void buildEarlyPollyPipeline(llvm::ModulePassManager &MPM,
595  llvm::OptimizationLevel Level) {
596  bool EnableForOpt =
597  shouldEnablePollyForOptimization() && Level.isOptimizingForSpeed();
598  if (!shouldEnablePollyForDiagnostic() && !EnableForOpt)
599  return;
600 
601  FunctionPassManager FPM = buildCanonicalicationPassesForNPM(MPM, Level);
602 
603  if (DumpBefore || !DumpBeforeFile.empty()) {
604  MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
605 
606  if (DumpBefore)
607  MPM.addPass(DumpModulePass("-before", true));
608  for (auto &Filename : DumpBeforeFile)
609  MPM.addPass(DumpModulePass(Filename, false));
610 
611  FPM = FunctionPassManager();
612  }
613 
614  buildCommonPollyPipeline(FPM, Level, EnableForOpt);
615  MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
616 
617  if (DumpAfter)
618  MPM.addPass(DumpModulePass("-after", true));
619  for (auto &Filename : DumpAfterFile)
620  MPM.addPass(DumpModulePass(Filename, false));
621 }
622 
623 static void buildLatePollyPipeline(FunctionPassManager &PM,
624  llvm::OptimizationLevel Level) {
625  bool EnableForOpt =
626  shouldEnablePollyForOptimization() && Level.isOptimizingForSpeed();
627  if (!shouldEnablePollyForDiagnostic() && !EnableForOpt)
628  return;
629 
630  if (DumpBefore)
631  PM.addPass(DumpFunctionPass("-before"));
632  if (!DumpBeforeFile.empty())
633  llvm::report_fatal_error(
634  "Option -polly-dump-before-file at -polly-position=late "
635  "not supported with NPM",
636  false);
637 
638  buildCommonPollyPipeline(PM, Level, EnableForOpt);
639 
640  if (DumpAfter)
641  PM.addPass(DumpFunctionPass("-after"));
642  if (!DumpAfterFile.empty())
643  llvm::report_fatal_error(
644  "Option -polly-dump-after-file at -polly-position=late "
645  "not supported with NPM",
646  false);
647 }
648 
649 /// Register Polly to be available as an optimizer
650 ///
651 ///
652 /// We can currently run Polly at three different points int the pass manager.
653 /// a) very early, b) after the canonicalizing loop transformations and c) right
654 /// before the vectorizer.
655 ///
656 /// The default is currently a), to register Polly such that it runs as early as
657 /// possible. This has several implications:
658 ///
659 /// 1) We need to schedule more canonicalization passes
660 ///
661 /// As nothing is run before Polly, it is necessary to run a set of preparing
662 /// transformations before Polly to canonicalize the LLVM-IR and to allow
663 /// Polly to detect and understand the code.
664 ///
665 /// 2) LICM and LoopIdiom pass have not yet been run
666 ///
667 /// Loop invariant code motion as well as the loop idiom recognition pass make
668 /// it more difficult for Polly to transform code. LICM may introduce
669 /// additional data dependences that are hard to eliminate and the loop idiom
670 /// recognition pass may introduce calls to memset that we currently do not
671 /// understand. By running Polly early enough (meaning before these passes) we
672 /// avoid difficulties that may be introduced by these passes.
673 ///
674 /// 3) We get the full -O3 optimization sequence after Polly
675 ///
676 /// The LLVM-IR that is generated by Polly has been optimized on a high level,
677 /// but it may be rather inefficient on the lower/scalar level. By scheduling
678 /// Polly before all other passes, we have the full sequence of -O3
679 /// optimizations behind us, such that inefficiencies on the low level can
680 /// be optimized away.
681 ///
682 /// We are currently evaluating the benefit or running Polly at position b) or
683 /// c). b) is likely too early as it interacts with the inliner. c) is nice
684 /// as everything is fully inlined and canonicalized, but we need to be able
685 /// to handle LICMed code to make it useful.
686 static llvm::RegisterStandardPasses RegisterPollyOptimizerEarly(
687  llvm::PassManagerBuilder::EP_ModuleOptimizerEarly,
689 
690 static llvm::RegisterStandardPasses
691  RegisterPollyOptimizerLoopEnd(llvm::PassManagerBuilder::EP_LoopOptimizerEnd,
693 
694 static llvm::RegisterStandardPasses RegisterPollyOptimizerScalarLate(
695  llvm::PassManagerBuilder::EP_VectorizerStart,
697 
699 createScopAnalyses(FunctionAnalysisManager &FAM,
700  PassInstrumentationCallbacks *PIC) {
702 #define SCOP_ANALYSIS(NAME, CREATE_PASS) \
703  Proxy.getManager().registerPass([PIC] { \
704  (void)PIC; \
705  return CREATE_PASS; \
706  });
707 #include "PollyPasses.def"
708 
709  Proxy.getManager().registerPass(
710  [&FAM] { return FunctionAnalysisManagerScopProxy(FAM); });
711  return Proxy;
712 }
713 
714 static void registerFunctionAnalyses(FunctionAnalysisManager &FAM,
715  PassInstrumentationCallbacks *PIC) {
716 
717 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
718  FAM.registerPass([] { return CREATE_PASS; });
719 
720 #include "PollyPasses.def"
721 
722  FAM.registerPass([&FAM, PIC] { return createScopAnalyses(FAM, PIC); });
723 }
724 
725 static bool
726 parseFunctionPipeline(StringRef Name, FunctionPassManager &FPM,
727  ArrayRef<PassBuilder::PipelineElement> Pipeline) {
728  if (llvm::parseAnalysisUtilityPasses<OwningScopAnalysisManagerFunctionProxy>(
729  "polly-scop-analyses", Name, FPM))
730  return true;
731 
732 #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
733  if (llvm::parseAnalysisUtilityPasses< \
734  std::remove_reference<decltype(CREATE_PASS)>::type>(NAME, Name, \
735  FPM)) \
736  return true;
737 
738 #define FUNCTION_PASS(NAME, CREATE_PASS) \
739  if (Name == NAME) { \
740  FPM.addPass(CREATE_PASS); \
741  return true; \
742  }
743 
744 #include "PollyPasses.def"
745  return false;
746 }
747 
748 static bool parseScopPass(StringRef Name, ScopPassManager &SPM,
749  PassInstrumentationCallbacks *PIC) {
750 #define SCOP_ANALYSIS(NAME, CREATE_PASS) \
751  if (llvm::parseAnalysisUtilityPasses< \
752  std::remove_reference<decltype(CREATE_PASS)>::type>(NAME, Name, \
753  SPM)) \
754  return true;
755 
756 #define SCOP_PASS(NAME, CREATE_PASS) \
757  if (Name == NAME) { \
758  SPM.addPass(CREATE_PASS); \
759  return true; \
760  }
761 
762 #include "PollyPasses.def"
763 
764  return false;
765 }
766 
767 static bool parseScopPipeline(StringRef Name, FunctionPassManager &FPM,
768  PassInstrumentationCallbacks *PIC,
769  ArrayRef<PassBuilder::PipelineElement> Pipeline) {
770  if (Name != "scop")
771  return false;
772  if (!Pipeline.empty()) {
773  ScopPassManager SPM;
774  for (const auto &E : Pipeline)
775  if (!parseScopPass(E.Name, SPM, PIC))
776  return false;
777  FPM.addPass(createFunctionToScopPassAdaptor(std::move(SPM)));
778  }
779  return true;
780 }
781 
782 static bool isScopPassName(StringRef Name) {
783 #define SCOP_ANALYSIS(NAME, CREATE_PASS) \
784  if (Name == "require<" NAME ">") \
785  return true; \
786  if (Name == "invalidate<" NAME ">") \
787  return true;
788 
789 #define SCOP_PASS(NAME, CREATE_PASS) \
790  if (Name == NAME) \
791  return true;
792 
793 #include "PollyPasses.def"
794 
795  return false;
796 }
797 
798 static bool
799 parseTopLevelPipeline(llvm::ModulePassManager &MPM,
800  PassInstrumentationCallbacks *PIC,
801  ArrayRef<PassBuilder::PipelineElement> Pipeline) {
802  std::vector<PassBuilder::PipelineElement> FullPipeline;
803  StringRef FirstName = Pipeline.front().Name;
804 
805  if (!isScopPassName(FirstName))
806  return false;
807 
808  FunctionPassManager FPM;
809  ScopPassManager SPM;
810 
811  for (auto &Element : Pipeline) {
812  auto &Name = Element.Name;
813  auto &InnerPipeline = Element.InnerPipeline;
814  if (!InnerPipeline.empty()) // Scop passes don't have inner pipelines
815  return false;
816  if (!parseScopPass(Name, SPM, PIC))
817  return false;
818  }
819 
820  FPM.addPass(createFunctionToScopPassAdaptor(std::move(SPM)));
821  MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
822 
823  return true;
824 }
825 
826 void registerPollyPasses(PassBuilder &PB) {
827  PassInstrumentationCallbacks *PIC = PB.getPassInstrumentationCallbacks();
828  PB.registerAnalysisRegistrationCallback([PIC](FunctionAnalysisManager &FAM) {
829  registerFunctionAnalyses(FAM, PIC);
830  });
831  PB.registerPipelineParsingCallback(parseFunctionPipeline);
832  PB.registerPipelineParsingCallback(
833  [PIC](StringRef Name, FunctionPassManager &FPM,
834  ArrayRef<PassBuilder::PipelineElement> Pipeline) -> bool {
835  return parseScopPipeline(Name, FPM, PIC, Pipeline);
836  });
837  PB.registerParseTopLevelPipelineCallback(
838  [PIC](llvm::ModulePassManager &MPM,
839  ArrayRef<PassBuilder::PipelineElement> Pipeline) -> bool {
840  return parseTopLevelPipeline(MPM, PIC, Pipeline);
841  });
842 
843  switch (PassPosition) {
844  case POSITION_EARLY:
845  PB.registerPipelineStartEPCallback(buildEarlyPollyPipeline);
846  break;
848  llvm::report_fatal_error(
849  "Option -polly-position=after-loopopt not supported with NPM", false);
850  break;
852  PB.registerVectorizerStartEPCallback(buildLatePollyPipeline);
853  break;
854  }
855 }
856 } // namespace polly
857 
858 llvm::PassPluginLibraryInfo getPollyPluginInfo() {
859  return {LLVM_PLUGIN_API_VERSION, "Polly", LLVM_VERSION_STRING,
861 }
polly::createDeLICMWrapperPass
llvm::Pass * createDeLICMWrapperPass()
Create a new DeLICM pass instance.
Definition: DeLICM.cpp:1494
llvm::initializeDeLICMWrapperPassPass
void initializeDeLICMWrapperPassPass(llvm::PassRegistry &)
polly::isScopPassName
static bool isScopPassName(StringRef Name)
Definition: RegisterPasses.cpp:782
DumpModulePass.h
polly::DumpAfterFile
static cl::list< std::string > DumpAfterFile("polly-dump-after-file", cl::desc("Dump module after Polly transformations to the given file"), cl::cat(PollyCategory))
ForwardOpTree.h
llvm::initializeIslAstInfoWrapperPassPass
void initializeIslAstInfoWrapperPassPass(llvm::PassRegistry &)
polly::OPTIMIZER_ISL
@ OPTIMIZER_ISL
Definition: RegisterPasses.cpp:81
polly::shouldEnablePollyForDiagnostic
static bool shouldEnablePollyForDiagnostic()
Definition: RegisterPasses.cpp:426
polly::CodePreparationPass
Definition: CodePreparation.h:19
polly::PollyEnabled
static cl::opt< bool > PollyEnabled("polly", cl::desc("Enable the polly optimizer (with -O1, -O2 or -O3)"), cl::cat(PollyCategory))
polly::PollyOnlyPrinter
static cl::opt< bool > PollyOnlyPrinter("polly-dot-only", cl::desc("Enable the Polly DOT printer in -O3 (no BB content)"), cl::Hidden, cl::value_desc("Run the Polly DOT printer at -O3 (no BB content"), cl::init(false), cl::cat(PollyCategory))
DependenceInfo.h
polly::VECTORIZER_NONE
@ VECTORIZER_NONE
Definition: CodeGeneration.h:19
polly::PassPositionChoice
PassPositionChoice
Definition: RegisterPasses.cpp:75
llvm::initializeFlattenSchedulePrinterLegacyPassPass
void initializeFlattenSchedulePrinterLegacyPassPass(llvm::PassRegistry &)
polly::parseFunctionPipeline
static bool parseFunctionPipeline(StringRef Name, FunctionPassManager &FPM, ArrayRef< PassBuilder::PipelineElement > Pipeline)
Definition: RegisterPasses.cpp:726
polly::createJSONImporterPass
llvm::Pass * createJSONImporterPass()
Definition: JSONExporter.cpp:796
DeadCodeElimination.h
polly::PassPosition
static cl::opt< PassPositionChoice > PassPosition("polly-position", cl::desc("Where to run polly in the pass pipeline"), cl::values(clEnumValN(POSITION_EARLY, "early", "Before everything"), clEnumValN(POSITION_AFTER_LOOPOPT, "after-loopopt", "After the loop optimizer (but within the inline cycle)"), clEnumValN(POSITION_BEFORE_VECTORIZER, "before-vectorizer", "Right before the vectorizer")), cl::Hidden, cl::init(POSITION_BEFORE_VECTORIZER), cl::cat(PollyCategory))
polly::CodeGenerationPass
Definition: CodeGeneration.h:31
llvm::initializeDumpModuleWrapperPassPass
void initializeDumpModuleWrapperPassPass(llvm::PassRegistry &)
llvm::initializeScopDetectionPrinterLegacyPassPass
void initializeScopDetectionPrinterLegacyPassPass(llvm::PassRegistry &)
llvm::initializeDependenceInfoPrinterLegacyFunctionPassPass
void initializeDependenceInfoPrinterLegacyFunctionPassPass(llvm::PassRegistry &)
llvm::initializeDeLICMPrinterLegacyPassPass
void initializeDeLICMPrinterLegacyPassPass(llvm::PassRegistry &)
polly::VECTORIZER_STRIPMINE
@ VECTORIZER_STRIPMINE
Definition: CodeGeneration.h:20
polly::buildCommonPollyPipeline
static void buildCommonPollyPipeline(FunctionPassManager &PM, OptimizationLevel Level, bool EnableForOpt)
Add the pass sequence required for Polly to the New Pass Manager.
Definition: RegisterPasses.cpp:491
polly::Target
static cl::opt< TargetChoice > Target("polly-target", cl::desc("The hardware to target"), cl::values(clEnumValN(TARGET_CPU, "cpu", "generate CPU code")), cl::init(TARGET_CPU), cl::cat(PollyCategory))
polly::buildCanonicalicationPassesForNPM
llvm::FunctionPassManager buildCanonicalicationPassesForNPM(llvm::ModulePassManager &MPM, llvm::OptimizationLevel Level)
Definition: Canonicalization.cpp:94
polly::DeadCodeElimPass
Definition: DeadCodeElimination.h:27
CodePreparation.h
polly::createIslAstInfoWrapperPassPass
llvm::Pass * createIslAstInfoWrapperPassPass()
Definition: IslAst.cpp:812
polly::CodeGeneration
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")), cl::Hidden, cl::init(CODEGEN_FULL), cl::cat(PollyCategory))
llvm::initializeCodePreparationPass
void initializeCodePreparationPass(llvm::PassRegistry &)
polly::createDOTOnlyViewerWrapperPass
llvm::Pass * createDOTOnlyViewerWrapperPass()
Definition: ScopGraphPrinter.cpp:223
llvm::initializeIslAstInfoPrinterLegacyPassPass
void initializeIslAstInfoPrinterLegacyPassPass(llvm::PassRegistry &)
llvm::initializeDependenceInfoPass
void initializeDependenceInfoPass(llvm::PassRegistry &)
llvm::initializeDeadCodeElimWrapperPassPass
void initializeDeadCodeElimWrapperPassPass(llvm::PassRegistry &)
PollyCategory
cl::OptionCategory PollyCategory("Polly Options", "Configure the polly loop optimizer")
polly::CODEGEN_FULL
@ CODEGEN_FULL
Definition: RegisterPasses.cpp:100
polly::registerFunctionAnalyses
static void registerFunctionAnalyses(FunctionAnalysisManager &FAM, PassInstrumentationCallbacks *PIC)
Definition: RegisterPasses.cpp:714
polly::CODEGEN_AST
@ CODEGEN_AST
Definition: RegisterPasses.cpp:100
polly::PruneUnprofitablePass
Definition: PruneUnprofitable.h:26
llvm::initializeDependenceInfoWrapperPassPass
void initializeDependenceInfoWrapperPassPass(llvm::PassRegistry &)
polly::ScopViewer
Definition: ScopGraphPrinter.h:73
llvm::initializeScopInfoPrinterLegacyRegionPassPass
void initializeScopInfoPrinterLegacyRegionPassPass(llvm::PassRegistry &)
polly::CodeGenChoice
CodeGenChoice
Definition: RegisterPasses.cpp:100
polly::ScopAnalysisManager
AnalysisManager< Scop, ScopStandardAnalysisResults & > ScopAnalysisManager
Definition: ScopPass.h:46
polly::EnableDeLICM
static cl::opt< bool > EnableDeLICM("polly-enable-delicm", cl::desc("Eliminate scalar loop carried dependences"), cl::Hidden, cl::init(true), cl::cat(PollyCategory))
polly::parseScopPass
static bool parseScopPass(StringRef Name, ScopPassManager &SPM, PassInstrumentationCallbacks *PIC)
Definition: RegisterPasses.cpp:748
CodegenCleanup.h
llvm::initializePollyCanonicalizePass
void initializePollyCanonicalizePass(llvm::PassRegistry &)
init
void GMPQAPI() init(mp_rat x)
Definition: gmp_compat.c:64
polly::EnablePolyhedralInfo
static cl::opt< bool > EnablePolyhedralInfo("polly-enable-polyhedralinfo", cl::desc("Enable polyhedral interface of Polly"), cl::Hidden, cl::init(false), cl::cat(PollyCategory))
llvm::initializeScopInfoPrinterLegacyFunctionPassPass
void initializeScopInfoPrinterLegacyFunctionPassPass(PassRegistry &)
llvm::initializeJSONImporterPrinterLegacyPassPass
void initializeJSONImporterPrinterLegacyPassPass(llvm::PassRegistry &)
llvm::initializeDependenceInfoPrinterLegacyPassPass
void initializeDependenceInfoPrinterLegacyPassPass(llvm::PassRegistry &)
LinkAllPasses.h
polly::PollyPrinter
static cl::opt< bool > PollyPrinter("polly-dot", cl::desc("Enable the Polly DOT printer in -O3"), cl::Hidden, cl::value_desc("Run the Polly DOT printer at -O3"), cl::init(false), cl::cat(PollyCategory))
llvm::initializeFlattenSchedulePass
void initializeFlattenSchedulePass(llvm::PassRegistry &)
PruneUnprofitable.h
llvm::initializeScopInfoWrapperPassPass
void initializeScopInfoWrapperPassPass(PassRegistry &)
polly::EnablePruneUnprofitable
static cl::opt< bool > EnablePruneUnprofitable("polly-enable-prune-unprofitable", cl::desc("Bail out on unprofitable SCoPs before rescheduling"), cl::Hidden, cl::init(true), cl::cat(PollyCategory))
llvm::initializeJSONExporterPass
void initializeJSONExporterPass(llvm::PassRegistry &)
polly::parseScopPipeline
static bool parseScopPipeline(StringRef Name, FunctionPassManager &FPM, PassInstrumentationCallbacks *PIC, ArrayRef< PassBuilder::PipelineElement > Pipeline)
Definition: RegisterPasses.cpp:767
getPollyPluginInfo
llvm::PassPluginLibraryInfo getPollyPluginInfo()
Definition: RegisterPasses.cpp:858
polly::ScopStandardAnalysisResults
Definition: ScopPass.h:185
polly::registerPollyLoopOptimizerEndPasses
static void registerPollyLoopOptimizerEndPasses(const llvm::PassManagerBuilder &Builder, llvm::legacy::PassManagerBase &PM)
Definition: RegisterPasses.cpp:452
IslAst.h
polly::registerCanonicalicationPasses
void registerCanonicalicationPasses(llvm::legacy::PassManagerBase &PM)
Schedule a set of canonicalization passes to prepare for Polly.
Definition: Canonicalization.cpp:42
polly::SPMUpdater
Definition: ScopPass.h:194
polly::OptimizerChoice
OptimizerChoice
Definition: RegisterPasses.cpp:81
MaximalStaticExpansion.h
polly::TARGET_CPU
@ TARGET_CPU
Definition: RegisterPasses.cpp:108
polly::OwningInnerAnalysisManagerProxy
Definition: ScopPass.h:127
polly::EnableSimplify
static cl::opt< bool > EnableSimplify("polly-enable-simplify", cl::desc("Simplify SCoP after optimizations"), cl::init(true), cl::cat(PollyCategory))
polly::OwningInnerAnalysisManagerProxy::getManager
AnalysisManagerT & getManager()
Definition: ScopPass.h:139
ScopInfo.h
llvm::initializeForwardOpTreePrinterLegacyPassPass
void initializeForwardOpTreePrinterLegacyPassPass(PassRegistry &)
polly::CODEGEN_NONE
@ CODEGEN_NONE
Definition: RegisterPasses.cpp:100
polly::buildLatePollyPipeline
static void buildLatePollyPipeline(FunctionPassManager &PM, llvm::OptimizationLevel Level)
Definition: RegisterPasses.cpp:623
llvm::initializeScopInlinerPass
void initializeScopInlinerPass(llvm::PassRegistry &)
polly::VectorizerChoice
VectorizerChoice
Definition: CodeGeneration.h:18
polly::OwningScopAnalysisManagerFunctionProxy
OwningInnerAnalysisManagerProxy< ScopAnalysisManager, Function > OwningScopAnalysisManagerFunctionProxy
Definition: ScopPass.h:153
llvm::initializeJSONImporterPass
void initializeJSONImporterPass(llvm::PassRegistry &)
polly::Vectorizer
static cl::opt< VectorizerChoice, true > Vectorizer("polly-vectorizer", cl::desc("Select the vectorization strategy"), cl::values(clEnumValN(VECTORIZER_NONE, "none", "No Vectorization"), clEnumValN(VECTORIZER_POLLY, "polly", "Polly internal vectorizer"), clEnumValN(VECTORIZER_STRIPMINE, "stripmine", "Strip-mine outer loops for the loop-vectorizer to trigger")), cl::location(PollyVectorizerChoice), cl::init(VECTORIZER_NONE), cl::cat(PollyCategory))
polly::shouldEnablePollyForOptimization
static bool shouldEnablePollyForOptimization()
Definition: RegisterPasses.cpp:424
llvm::initializeCodeGenerationPass
void initializeCodeGenerationPass(llvm::PassRegistry &)
polly::CFGPrinter
static cl::opt< bool > CFGPrinter("polly-view-cfg", cl::desc("Show the Polly CFG right after code generation"), cl::Hidden, cl::init(false), cl::cat(PollyCategory))
llvm::initializeIslScheduleOptimizerWrapperPassPass
void initializeIslScheduleOptimizerWrapperPassPass(llvm::PassRegistry &)
polly::createForwardOpTreeWrapperPass
llvm::Pass * createForwardOpTreeWrapperPass()
Definition: ForwardOpTree.cpp:1180
polly::createPruneUnprofitableWrapperPass
llvm::Pass * createPruneUnprofitableWrapperPass()
Definition: PruneUnprofitable.cpp:101
polly::createCodeGenerationPass
llvm::Pass * createCodeGenerationPass()
Definition: CodeGeneration.cpp:374
polly::RegisterPollyOptimizerEarly
static llvm::RegisterStandardPasses RegisterPollyOptimizerEarly(llvm::PassManagerBuilder::EP_ModuleOptimizerEarly, registerPollyEarlyAsPossiblePasses)
Register Polly to be available as an optimizer.
polly::createDeadCodeElimWrapperPass
llvm::Pass * createDeadCodeElimWrapperPass()
Definition: DeadCodeElimination.cpp:168
llvm::initializeScopDetectionWrapperPassPass
void initializeScopDetectionWrapperPassPass(llvm::PassRegistry &)
polly::PollyTrackFailures
bool PollyTrackFailures
Definition: ScopDetection.cpp:233
polly::IslScheduleOptimizerPass
Definition: ScheduleOptimizer.h:23
polly::DeLICMPass
Definition: DeLICM.h:34
polly::TargetChoice
TargetChoice
Definition: RegisterPasses.cpp:108
polly::OPTIMIZER_NONE
@ OPTIMIZER_NONE
Definition: RegisterPasses.cpp:81
polly::IslAstAnalysis
Definition: IslAst.h:166
PolyhedralInfo.h
polly::DumpModulePass
A pass that prints the module into a file.
Definition: DumpModulePass.h:37
polly::DumpFunctionPass
A pass that isolates a function into a new Module and writes it into a file.
Definition: DumpFunctionPass.h:28
polly::createScopDetectionWrapperPassPass
llvm::Pass * createScopDetectionWrapperPassPass()
Definition: ScopDetection.cpp:2015
polly::registerPollyEarlyAsPossiblePasses
static void registerPollyEarlyAsPossiblePasses(const llvm::PassManagerBuilder &Builder, llvm::legacy::PassManagerBase &PM)
Definition: RegisterPasses.cpp:437
llvm::initializePruneUnprofitableWrapperPassPass
void initializePruneUnprofitableWrapperPassPass(llvm::PassRegistry &)
polly::createPolyhedralInfoPass
llvm::Pass * createPolyhedralInfoPass()
Definition: PolyhedralInfo.cpp:155
llvm::initializeSimplifyPrinterLegacyPassPass
void initializeSimplifyPrinterLegacyPassPass(llvm::PassRegistry &)
polly::parseTopLevelPipeline
static bool parseTopLevelPipeline(llvm::ModulePassManager &MPM, PassInstrumentationCallbacks *PIC, ArrayRef< PassBuilder::PipelineElement > Pipeline)
Definition: RegisterPasses.cpp:799
polly::RegisterPollyOptimizerLoopEnd
static llvm::RegisterStandardPasses RegisterPollyOptimizerLoopEnd(llvm::PassManagerBuilder::EP_LoopOptimizerEnd, registerPollyLoopOptimizerEndPasses)
polly::RegisterPollyOptimizerScalarLate
static llvm::RegisterStandardPasses RegisterPollyOptimizerScalarLate(llvm::PassManagerBuilder::EP_VectorizerStart, registerPollyScalarOptimizerLatePasses)
llvm::initializeIslScheduleOptimizerPrinterLegacyPassPass
void initializeIslScheduleOptimizerPrinterLegacyPassPass(llvm::PassRegistry &)
ScopDetection.h
llvm::initializeForwardOpTreeWrapperPassPass
void initializeForwardOpTreeWrapperPassPass(PassRegistry &)
polly::createDOTOnlyPrinterWrapperPass
llvm::Pass * createDOTOnlyPrinterWrapperPass()
Definition: ScopGraphPrinter.cpp:231
llvm::initializeSimplifyWrapperPassPass
void initializeSimplifyWrapperPassPass(llvm::PassRegistry &)
polly::createScopInfoRegionPassPass
llvm::Pass * createScopInfoRegionPassPass()
polly::ScopPrinter
Definition: ScopGraphPrinter.h:84
Canonicalization.h
polly::POSITION_BEFORE_VECTORIZER
@ POSITION_BEFORE_VECTORIZER
Definition: RegisterPasses.cpp:78
polly::ScopOnlyPrinter
Definition: ScopGraphPrinter.h:88
polly
Definition: Canonicalization.h:20
polly::JSONImportPass
This pass imports a scop from a jscop file.
Definition: JSONExporter.h:29
polly::ScopPassManager
PassManager< Scop, ScopAnalysisManager, ScopStandardAnalysisResults &, SPMUpdater & > ScopPassManager
Definition: ScopPass.h:156
polly::TARGET_GPU
@ TARGET_GPU
Definition: RegisterPasses.cpp:108
polly::PollyVectorizerChoice
VectorizerChoice PollyVectorizerChoice
Definition: RegisterPasses.cpp:121
polly::FullyIndexedStaticExpansion
static cl::opt< bool > FullyIndexedStaticExpansion("polly-enable-mse", cl::desc("Fully expand the memory accesses of the detected Scops"), cl::Hidden, cl::cat(PollyCategory))
JSONExporter.h
ScopGraphPrinter.h
polly::GPURuntimeChoice
GPURuntime GPURuntimeChoice
Use for pass instantiation defaults.
Definition: PPCGCodeGeneration.cpp:114
polly::createCodegenCleanupPass
llvm::FunctionPass * createCodegenCleanupPass()
Definition: CodegenCleanup.cpp:135
polly::createScopAnalyses
static OwningScopAnalysisManagerFunctionProxy createScopAnalyses(FunctionAnalysisManager &FAM, PassInstrumentationCallbacks *PIC)
Definition: RegisterPasses.cpp:699
llvm::initializePolyhedralInfoPrinterLegacyPassPass
void initializePolyhedralInfoPrinterLegacyPassPass(llvm::PassRegistry &)
polly::FunctionAnalysisManagerScopProxy
OuterAnalysisManagerProxy< FunctionAnalysisManager, Scop, ScopStandardAnalysisResults & > FunctionAnalysisManagerScopProxy
Definition: ScopPass.h:51
polly::initializePollyPasses
void initializePollyPasses(llvm::PassRegistry &Registry)
Definition: RegisterPasses.cpp:244
polly::DumpBeforeFile
static cl::list< std::string > DumpBeforeFile("polly-dump-before-file", cl::desc("Dump module before Polly transformations to the given file"), cl::cat(PollyCategory))
polly::createFunctionToScopPassAdaptor
FunctionToScopPassAdaptor< ScopPassT > createFunctionToScopPassAdaptor(ScopPassT Pass)
Definition: ScopPass.h:287
Simplify.h
polly::createSimplifyWrapperPass
llvm::Pass * createSimplifyWrapperPass(int)
Create a Simplify pass.
Definition: Simplify.cpp:844
polly::ScopOnlyViewer
Definition: ScopGraphPrinter.h:79
polly::registerPollyPasses
void registerPollyPasses(llvm::PassBuilder &PB)
polly::EnableForwardOpTree
static cl::opt< bool > EnableForwardOpTree("polly-enable-optree", cl::desc("Enable operand tree forwarding"), cl::Hidden, cl::init(true), cl::cat(PollyCategory))
polly::createMaximalStaticExpansionPass
llvm::Pass * createMaximalStaticExpansionPass()
Definition: MaximalStaticExpansion.cpp:545
polly::ImportJScop
static cl::opt< bool > ImportJScop("polly-import", cl::desc("Import the polyhedral description of the detected Scops"), cl::Hidden, cl::cat(PollyCategory))
polly::PollyDetectOnly
static cl::opt< bool > PollyDetectOnly("polly-only-scop-detection", cl::desc("Only run scop detection, but no other optimizations"), cl::cat(PollyCategory))
polly::SimplifyPass
Definition: Simplify.h:55
polly::Optimizer
static cl::opt< OptimizerChoice > Optimizer("polly-optimizer", cl::desc("Select the scheduling optimizer"), cl::values(clEnumValN(OPTIMIZER_NONE, "none", "No optimizer"), clEnumValN(OPTIMIZER_ISL, "isl", "The isl scheduling optimizer")), cl::Hidden, cl::init(OPTIMIZER_ISL), cl::cat(PollyCategory))
polly::DumpBefore
static cl::opt< bool > DumpBefore("polly-dump-before", cl::desc("Dump module before Polly transformations into a file " "suffixed with \"-before\""), cl::init(false), cl::cat(PollyCategory))
polly::createCodePreparationPass
llvm::Pass * createCodePreparationPass()
Definition: CodePreparation.cpp:114
polly::createIslScheduleOptimizerWrapperPass
llvm::Pass * createIslScheduleOptimizerWrapperPass()
Definition: ScheduleOptimizer.cpp:986
polly::createJSONExporterPass
llvm::Pass * createJSONExporterPass()
Definition: JSONExporter.cpp:758
polly::ForwardOpTreePass
Definition: ForwardOpTree.h:26
polly::POSITION_AFTER_LOOPOPT
@ POSITION_AFTER_LOOPOPT
Definition: RegisterPasses.cpp:77
polly::TARGET_HYBRID
@ TARGET_HYBRID
Definition: RegisterPasses.cpp:108
polly::createDumpModuleWrapperPass
llvm::ModulePass * createDumpModuleWrapperPass(std::string Filename, bool IsSuffix)
Create a pass that prints the module into a file.
Definition: DumpModulePass.cpp:88
llvm::initializeCodegenCleanupPass
void initializeCodegenCleanupPass(llvm::PassRegistry &)
polly::Scop
Static Control Part.
Definition: ScopInfo.h:1628
polly::ExportJScop
static cl::opt< bool > ExportJScop("polly-export", cl::desc("Export the polyhedral description of the detected Scops"), cl::Hidden, cl::cat(PollyCategory))
llvm::initializeScopInfoRegionPassPass
void initializeScopInfoRegionPassPass(PassRegistry &)
CodeGeneration.h
polly::PollyOnlyViewer
static cl::opt< bool > PollyOnlyViewer("polly-show-only", cl::desc("Highlight the code regions that will be optimized in " "a (CFG only BBs)"), cl::init(false), cl::cat(PollyCategory))
llvm::initializeMaximalStaticExpanderWrapperPassPass
void initializeMaximalStaticExpanderWrapperPassPass(llvm::PassRegistry &)
polly::DumpAfter
static cl::opt< bool > DumpAfter("polly-dump-after", cl::desc("Dump module after Polly transformations into a file " "suffixed with \"-after\""), cl::init(false), cl::cat(PollyCategory))
polly::POSITION_EARLY
@ POSITION_EARLY
Definition: RegisterPasses.cpp:76
polly::createDOTViewerWrapperPass
llvm::Pass * createDOTViewerWrapperPass()
Definition: ScopGraphPrinter.cpp:219
polly::GPUArchChoice
GPUArch GPUArchChoice
Definition: PPCGCodeGeneration.cpp:125
polly::DeadCodeElim
static cl::opt< bool > DeadCodeElim("polly-run-dce", cl::desc("Run the dead code elimination"), cl::Hidden, cl::cat(PollyCategory))
ScheduleOptimizer.h
DeLICM.h
polly::registerPollyScalarOptimizerLatePasses
static void registerPollyScalarOptimizerLatePasses(const llvm::PassManagerBuilder &Builder, llvm::legacy::PassManagerBase &PM)
Definition: RegisterPasses.cpp:468
polly::createDOTPrinterWrapperPass
llvm::Pass * createDOTPrinterWrapperPass()
Definition: ScopGraphPrinter.cpp:227
polly::PollyViewer
static cl::opt< bool > PollyViewer("polly-show", cl::desc("Highlight the code regions that will be optimized in a " "(CFG BBs and LLVM-IR instructions)"), cl::cat(PollyCategory))
RegisterPasses.h
llvm::initializePolyhedralInfoPass
void initializePolyhedralInfoPass(llvm::PassRegistry &)
DumpFunctionPass.h
polly::buildEarlyPollyPipeline
static void buildEarlyPollyPipeline(llvm::ModulePassManager &MPM, llvm::OptimizationLevel Level)
Definition: RegisterPasses.cpp:594
polly::VECTORIZER_POLLY
@ VECTORIZER_POLLY
Definition: CodeGeneration.h:21