diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-03-27 16:12:26 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-03-27 16:12:26 +0000 |
commit | 733b8571b4a3d432caed5e48c94784f930bc0687 (patch) | |
tree | f2e1b0ea68570260aba96090e8ad5a8eca370b1c /llvm/lib | |
parent | 566fba03de5a3449b9ca8cb5eb64d53080b3fc03 (diff) | |
download | bcm5719-llvm-733b8571b4a3d432caed5e48c94784f930bc0687.tar.gz bcm5719-llvm-733b8571b4a3d432caed5e48c94784f930bc0687.zip |
MIR: Freeze reserved regs after parsing everything
The AMDGPU implementation of getReservedRegs depends on
MachineFunctionInfo fields that are parsed from the YAML section. This
was reserving the wrong register since it was setting the reserved
regs before parsing the correct one.
Some tests were relying on the default reserved set for the assumed
default calling convention.
llvm-svn: 357083
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 3598cbe22ce..74d308de8bd 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -426,6 +426,14 @@ MIRParserImpl::initializeMachineFunction(const yaml::MachineFunction &YamlMF, } } + // Set the reserved registers after parsing MachineFuncInfo. The target may + // have been recording information used to select the reserved registers + // there. + // FIXME: This is a temporary workaround until the reserved registers can be + // serialized. + MachineRegisterInfo &MRI = MF.getRegInfo(); + MRI.freezeReservedRegs(MF); + computeFunctionProperties(MF); MF.getSubtarget().mirFileLoaded(MF); @@ -564,9 +572,6 @@ bool MIRParserImpl::setupRegisterInfo(const PerFunctionMIParsingState &PFS, } } - // FIXME: This is a temporary workaround until the reserved registers can be - // serialized. - MRI.freezeReservedRegs(MF); return Error; } |