def ssapass_passlist(optlevel): return ppipe.PassList([ simplifycfg_silcombine_passlist(), p.AllocBoxToStack, p.CopyForwarding, p.LowerAggregateInstrs, p.SILCombine, p.SROA, p.Mem2Reg, p.PerformanceConstantPropagation, p.DCE, p.CSE, p.SILCombine, simplifycfg_silcombine_passlist(), p.GlobalLoadStoreOpts, # Need to add proper argument here p.CodeMotion, p.GlobalARCOpts, p.SpeculativeDevirtualizer, p.SILLinker, inliner_for_optlevel(optlevel), p.SimplifyCFG, p.CodeMotion, p.GlobalARCOpts, ])
def lowlevel_loopopt_passlist(): return ppipe.PassList([ p.LICM, p.DCE, p.CSE, p.SILCombine, p.SimplifyCFG, ])
def lower_passlist(): return ppipe.PassList([ p.DeadFunctionElimination, p.DeadObjectElimination, p.GlobalOpt, p.CapturePropagation, p.ClosureSpecializer, p.SpeculativeDevirtualizer, p.FunctionSignatureOpts, ])
def diagnostic_passlist(): return ppipe.PassList([ p.CapturePromotion, p.AllocBoxToStack, p.InOutDeshadowing, p.NoReturnFolding, p.DefiniteInitialization, p.PredictableMemoryOptimizations, p.DiagnosticConstantPropagation, p.DiagnoseUnreachable, p.EmitDFDiagnostics, p.SplitNonCondBrCriticalEdges, ])
def highlevel_loopopt_passlist(): return ppipe.PassList([ p.LowerAggregateInstrs, p.SILCombine, p.SROA, p.Mem2Reg, p.DCE, p.SILCombine, simplifycfg_silcombine_passlist(), p.LoopRotate, p.DCE, p.CSE, p.SILCombine, p.SimplifyCFG, p.ABCOpt, p.DCE, p.COWArrayOpts, p.DCE, p.SwiftArrayOpts, ])
def simplifycfg_silcombine_passlist(): return ppipe.PassList([ p.SimplifyCFG, p.SILCombine, p.SimplifyCFG, ])