@@ -52,6 +52,10 @@ static llvm::cl::opt<bool> SILPrintCanonicalModule(
5252 " sil-print-canonical-module" , llvm::cl::init(false ),
5353 llvm::cl::desc(" Print the textual SIL module after diagnostics" ));
5454
55+ static llvm::cl::opt<bool > SILPrintFinalOSSAModule (
56+ " sil-print-final-ossa-module" , llvm::cl::init(false ),
57+ llvm::cl::desc(" Print the textual SIL module before lowering from OSSA" ));
58+
5559static llvm::cl::opt<bool > SILViewSILGenCFG (
5660 " sil-view-silgen-cfg" , llvm::cl::init(false ),
5761 llvm::cl::desc(" Enable the sil cfg viewer pass before diagnostics" ));
@@ -549,6 +553,9 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
549553 if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
550554 return ;
551555
556+ if (SILPrintFinalOSSAModule) {
557+ addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
558+ }
552559 P.addNonTransparentFunctionOwnershipModelEliminator ();
553560 }
554561
@@ -568,6 +575,9 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
568575 if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
569576 return ;
570577
578+ if (SILPrintFinalOSSAModule) {
579+ addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
580+ }
571581 P.addNonTransparentFunctionOwnershipModelEliminator ();
572582 }
573583
0 commit comments