[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 08:56:48 PDT 2021


foad updated this revision to Diff 378691.
foad added a comment.

Add test coverage.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111550

Files:
  llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
  llvm/test/CodeGen/Lanai/i32.ll


Index: llvm/test/CodeGen/Lanai/i32.ll
===================================================================
--- llvm/test/CodeGen/Lanai/i32.ll
+++ llvm/test/CodeGen/Lanai/i32.ll
@@ -1,4 +1,5 @@
 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -early-live-intervals | FileCheck %s
 
 ; Test that basic 32-bit integer operations assemble as expected.
 
Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
===================================================================
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1656,8 +1656,13 @@
     }
   }
 
-  if (LIS)
-    MF->verify(this, "After two-address instruction pass");
+  // 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");
+  }
 
   return MadeChange;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111550.378691.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211011/39ca5057/attachment.bin>


More information about the llvm-commits mailing list