[PATCH] D111550: [TwoAddressInstruction] Don't run machine verification on unclean targets

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 12:33:09 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1659-1665
+  // TODO: Remove this ad hoc verification in favor of the usual
+  // -verify-machineinstrs mechanism.
+  if (LIS) {
+    const LLVMTargetMachine &TM = MF->getTarget();
+    if (TM.isMachineVerifierClean())
+      MF->verify(this, "After two-address instruction pass");
+  }
----------------
MatzeB wrote:
> Could we just remove this code? Doesn't seem like we miss much since this is the last step of the pass before we would have a verifier pass scheduled anyway...
There is actually a subtle difference: if this pass is the last user of an analysis like LiveVariables, then calling MF->verify() here will verify that analysis, but scheduling a MachineVerifier pass afterwards will not, because the pass manager frees analyses immediately after their last user.

Because of that, this call to MF->verify() catches more problems than -verify-machineinstrs (or enabling LLVM_ENABLE_EXPENSIVE_CHECKS) does.

But I'd still be happy to remove it. I'll prepare a patch...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111550/new/

https://reviews.llvm.org/D111550



More information about the llvm-commits mailing list