[llvm] [CodeGen][NPM] Disable Machine verifier at the end of default pipelines (PR #208357)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 03:05:05 PDT 2026


================
@@ -618,7 +618,7 @@ Error CodeGenPassBuilder<Derived, TargetMachineT>::buildPipeline(
   if (auto Err = derived().addMachinePasses(PMW))
     return std::move(Err);
 
-  if (!Opt.DisableVerify)
+  if (!Opt.DisableVerify && TM.Options.EnableDefaultMachineVerifier)
     addMachineFunctionPass(MachineVerifierPass(), PMW);
----------------
jayfoad wrote:

As an alternative, how about wrapping this in `#ifdef EXPENSIVE_CHECKS`? Then we're in the same situation as with the old pass manager: test cases like [this](https://godbolt.org/) will fail verification in an EXPENSIVE_CHECKS build but we will still be able to get away with compiling them in a normal build.

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


More information about the llvm-commits mailing list