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; }