diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/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; } diff --git a/llvm/test/CodeGen/Lanai/i32.ll b/llvm/test/CodeGen/Lanai/i32.ll --- a/llvm/test/CodeGen/Lanai/i32.ll +++ b/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.