Skip to content

Commit b6ed6c6

Browse files
optimisanDanielCChen
authored andcommitted
[MIR] Add missing noteNewVirtualRegister callbacks (llvm#111634)
The delegates' callback isn't invoked on parsing new virtual registers. There are two places in the serialization where new virtual registers can be discovered: in register infos and in instructions.
1 parent f53afda commit b6ed6c6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

llvm/lib/CodeGen/MIRParser/MIParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,7 @@ bool MIParser::parseRegisterOperand(MachineOperand &Dest,
17861786

17871787
MRI.setRegClassOrRegBank(Reg, static_cast<RegisterBank *>(nullptr));
17881788
MRI.setType(Reg, Ty);
1789+
MRI.noteNewVirtualRegister(Reg);
17891790
}
17901791
}
17911792
} else if (consumeIfPresent(MIToken::lparen)) {

llvm/lib/CodeGen/MIRParser/MIRParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ bool MIRParserImpl::parseRegisterInfo(PerFunctionMIParsingState &PFS,
705705
FlagStringValue.Value + "'");
706706
Info.Flags.push_back(FlagValue);
707707
}
708+
RegInfo.noteNewVirtualRegister(Info.VReg);
708709
}
709710

710711
// Parse the liveins.

0 commit comments

Comments
 (0)