https://github.com/Akshat-Oke created https://github.com/llvm/llvm-project/pull/111634
None >From 2b877142d7a9346033d02e5a977d2dcaa440258c Mon Sep 17 00:00:00 2001 From: Akshat Oke <akshat....@amd.com> Date: Wed, 9 Oct 2024 05:01:22 +0000 Subject: [PATCH] [MIR] Add missing noteNewVirtualRegister callbacks --- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 1 + llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index f1d3ce9a563406..7aaa0f409d5ef9 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1786,6 +1786,7 @@ bool MIParser::parseRegisterOperand(MachineOperand &Dest, MRI.setRegClassOrRegBank(Reg, static_cast<RegisterBank *>(nullptr)); MRI.setType(Reg, Ty); + MRI.noteNewVirtualRegister(Reg); } } } else if (consumeIfPresent(MIToken::lparen)) { diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 0c8a3eb6c2d83d..f10a480f7e6160 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -652,10 +652,10 @@ MIRParserImpl::initializeMachineFunction(const yaml::MachineFunction &YamlMF, bool MIRParserImpl::parseRegisterInfo(PerFunctionMIParsingState &PFS, const yaml::MachineFunction &YamlMF) { MachineFunction &MF = PFS.MF; - MachineRegisterInfo &RegInfo = MF.getRegInfo(); + MachineRegisterInfo &MRI = MF.getRegInfo(); assert(RegInfo.tracksLiveness()); if (!YamlMF.TracksRegLiveness) - RegInfo.invalidateLiveness(); + MRI.invalidateLiveness(); SMDiagnostic Error; // Parse the virtual register information. @@ -705,6 +705,7 @@ bool MIRParserImpl::parseRegisterInfo(PerFunctionMIParsingState &PFS, FlagStringValue.Value + "'"); Info.Flags.push_back(FlagValue); } + MRI.noteNewVirtualRegister(Info.VReg); } // Parse the liveins. @@ -720,7 +721,7 @@ bool MIRParserImpl::parseRegisterInfo(PerFunctionMIParsingState &PFS, return error(Error, LiveIn.VirtualRegister.SourceRange); VReg = Info->VReg; } - RegInfo.addLiveIn(Reg, VReg); + MRI.addLiveIn(Reg, VReg); } // Parse the callee saved registers (Registers that will @@ -733,7 +734,7 @@ bool MIRParserImpl::parseRegisterInfo(PerFunctionMIParsingState &PFS, return error(Error, RegSource.SourceRange); CalleeSavedRegisters.push_back(Reg); } - RegInfo.setCalleeSavedRegs(CalleeSavedRegisters); + MRI.setCalleeSavedRegs(CalleeSavedRegisters); } return false; _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits