Revert to using LLVM's O0 pipeline for coroutines

The necessary passes for coroutines are changing between LLVM 14 and 15.
To not require another code path, rely on buildO0DefaultPipeline() like
before, but add any additional passes to the same pass manager.

Bug: b/229629349
Change-Id: Ie3989fae6910b49fc56eda531b82a6bc93792971
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/65429
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Reactor/LLVMJIT.cpp b/src/Reactor/LLVMJIT.cpp
index 74c7485..012e2f1 100644
--- a/src/Reactor/LLVMJIT.cpp
+++ b/src/Reactor/LLVMJIT.cpp
@@ -51,9 +51,6 @@
 #	include "llvm/Transforms/Scalar/SCCP.h"
 #	include "llvm/Transforms/Scalar/SROA.h"
 #	include "llvm/Transforms/Scalar/SimplifyCFG.h"
-#	include "llvm/Transforms/Coroutines/CoroCleanup.h"
-#	include "llvm/Transforms/Coroutines/CoroEarly.h"
-#	include "llvm/Transforms/Coroutines/CoroSplit.h"
 #else  // Legacy pass manager
 #	include "llvm/IR/LegacyPassManager.h"
 #	include "llvm/Pass.h"
@@ -898,12 +895,8 @@
 
 	if(coroutine.id)
 	{
-		// Run mandatory coroutine transforms.
-		pm.addPass(llvm::createModuleToFunctionPassAdaptor(llvm::CoroEarlyPass()));
-		llvm::CGSCCPassManager cgpm;
-		cgpm.addPass(llvm::CoroSplitPass());
-		pm.addPass(llvm::createModuleToPostOrderCGSCCPassAdaptor(std::move(cgpm)));
-		pm.addPass(llvm::createModuleToFunctionPassAdaptor(llvm::CoroCleanupPass()));
+		// Adds mandatory coroutine transforms.
+		pm = pb.buildO0DefaultPipeline(llvm::OptimizationLevel::O0);
 	}
 
 	if(__has_feature(memory_sanitizer) && msanInstrumentation)