Exemple #1
0
/// Perform semantic annotation/loop base optimizations.
void AddHighLevelLoopOptPasses(SILPassManager &PM) {
  // Perform classsic SSA optimizations for cleanup.
  PM.addLowerAggregateInstrs();
  PM.addSILCombine();
  PM.addSROA();
  PM.addMem2Reg();
  PM.addDCE();
  PM.addSILCombine();
  AddSimplifyCFGSILCombine(PM);

  // Run high-level loop opts.
  PM.addLoopRotate();

  // Cleanup.
  PM.addDCE();
  // Also CSE semantic calls.
  PM.addHighLevelCSE();
  PM.addSILCombine();
  PM.addSimplifyCFG();
  PM.addArrayCountPropagation();
  PM.addHighLevelLICM();
  PM.addRemovePins();
  PM.addABCOpt();
  // Cleanup.
  PM.addDCE();
  PM.addCOWArrayOpts();
  // Cleanup.
  PM.addDCE();
  PM.addSwiftArrayOpts();
}
Exemple #2
0
/// Perform semantic annotation/loop base optimizations.
void AddHighLevelLoopOptPasses(SILPassManager &PM) {
  // Perform classic SSA optimizations for cleanup.
  PM.addLowerAggregateInstrs();
  PM.addSILCombine();
  PM.addSROA();
  PM.addMem2Reg();
  PM.addDCE();
  PM.addSILCombine();
  AddSimplifyCFGSILCombine(PM);

  // Run high-level loop opts.
  PM.addLoopRotate();

  // Cleanup.
  PM.addDCE();
  // Also CSE semantic calls.
  PM.addHighLevelCSE();
  PM.addSILCombine();
  PM.addSimplifyCFG();
  PM.addHighLevelLICM();
  // Start of loop unrolling passes.
  PM.addArrayCountPropagation();
  // To simplify induction variable.
  PM.addSILCombine();
  PM.addLoopUnroll();
  PM.addSimplifyCFG();
  PM.addPerformanceConstantPropagation();
  PM.addSimplifyCFG();
  PM.addArrayElementPropagation();
  // End of unrolling passes.
  PM.addRemovePins();
  PM.addABCOpt();
  // Cleanup.
  PM.addDCE();
  PM.addCOWArrayOpts();
  // Cleanup.
  PM.addDCE();
  PM.addSwiftArrayOpts();
}