[clang] [clang][codegen] Add a verifier IR pass before any further passes. (PR #68015)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 18:37:31 PDT 2023


================
@@ -923,6 +923,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
   PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
 
   ModulePassManager MPM;
+  // Add a verifier pass, before any other passes, to catch CodeGen issues.
+  MPM.addPass(VerifierPass());
----------------
mizvekov wrote:

There is actually just an option to disable it, it's otherwise on by default.
See this post for more details: https://discourse.llvm.org/t/rfc-running-llvm-verifier-right-out-of-codegen/73823/4

I have changed the current MR to also add the new pass under the same flag, as it's useful to allow folks to disable it, but it's otherwise going to be on for the majority of cases.

https://github.com/llvm/llvm-project/pull/68015


More information about the cfe-commits mailing list