Beispiel #1
0
static void addMandatoryOptPipeline(SILPassPipelinePlan &P,
                                    const SILOptions &Options) {
  P.startPipeline("Guaranteed Passes");
  if (Options.EnableMandatorySemanticARCOpts) {
    P.addSemanticARCOpts();
  }
  P.addDiagnoseStaticExclusivity();
  P.addCapturePromotion();
  P.addAllocBoxToStack();
  P.addNoReturnFolding();
  P.addOwnershipModelEliminator();
  P.addMarkUninitializedFixup();
  P.addDefiniteInitialization();

  P.addAccessEnforcementSelection();
  P.addAccessMarkerElimination();

  P.addMandatoryInlining();
  P.addPredictableMemoryOptimizations();
  P.addDiagnosticConstantPropagation();
  P.addGuaranteedARCOpts();
  P.addDiagnoseUnreachable();
  P.addEmitDFDiagnostics();
  // Canonical swift requires all non cond_br critical edges to be split.
  P.addSplitNonCondBrCriticalEdges();
}
Beispiel #2
0
static void addMandatoryOptPipeline(SILPassPipelinePlan &P,
                                    const SILOptions &Options) {
  P.startPipeline("Guaranteed Passes");
  if (Options.EnableMandatorySemanticARCOpts) {
    P.addSemanticARCOpts();
  }
  P.addDiagnoseStaticExclusivity();
  P.addCapturePromotion();

  // Select access kind after capture promotion and before stack promotion.
  // This guarantees that stack-promotable boxes have [static] enforcement.
  P.addAccessEnforcementSelection();

  P.addAllocBoxToStack();
  P.addNoReturnFolding();
  addDefiniteInitialization(P);
  P.addClosureLifetimeFixup();
  P.addOwnershipModelEliminator();
  P.addMandatoryInlining();
  P.addMandatorySILLinker();
  P.addPredictableMemoryOptimizations();

  // Diagnostic ConstantPropagation must be rerun on deserialized functions
  // because it is sensitive to the assert configuration.
  // Consequently, certain optimization passes beyond this point will also rerun.
  P.addDiagnosticConstantPropagation();
  P.addGuaranteedARCOpts();
  P.addDiagnoseUnreachable();
  P.addDiagnoseInfiniteRecursion();
  P.addEmitDFDiagnostics();
  // Canonical swift requires all non cond_br critical edges to be split.
  P.addSplitNonCondBrCriticalEdges();
}