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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 15 04:40:26 PDT 2021


foad abandoned this revision.
foad added a comment.

Superseded by D111618 <https://reviews.llvm.org/D111618>.



================
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");
+  }
----------------
foad wrote:
> 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...
D111618.


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