From 1b6602275d3f902a91e2eab28f2ac506372d9065 Mon Sep 17 00:00:00 2001 From: Kang Zhang Date: Tue, 9 Jun 2020 07:39:42 +0000 Subject: [MachineVerifier] Add TiedOpsRewritten flag to fix verify two-address error Summary: Currently, MachineVerifier will attempt to verify that tied operands satisfy register constraints as soon as the function is no longer in SSA form. However, PHIElimination will take the function out of SSA form while TwoAddressInstructionPass will actually rewrite tied operands to match the constraints. PHIElimination runs first in the pipeline. Therefore, whenever the MachineVerifier is run after PHIElimination, it will encounter verification errors on any tied operands. This patch adds a function property called TiedOpsRewritten that will be set by TwoAddressInstructionPass and will control when the verifier checks tied operands. Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D80538 --- llvm/lib/CodeGen/MachineFunction.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 3e57e3c..6d45f08 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -98,6 +98,7 @@ static const char *getPropertyName(MachineFunctionProperties::Property Prop) { case P::RegBankSelected: return "RegBankSelected"; case P::Selected: return "Selected"; case P::TracksLiveness: return "TracksLiveness"; + case P::TiedOpsRewritten: return "TiedOpsRewritten"; } llvm_unreachable("Invalid machine function property"); } -- cgit v1.1