summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-03-27 16:12:26 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-03-27 16:12:26 +0000
commit733b8571b4a3d432caed5e48c94784f930bc0687 (patch)
treef2e1b0ea68570260aba96090e8ad5a8eca370b1c /llvm/lib/CodeGen/MIRParser/MIRParser.cpp
parent566fba03de5a3449b9ca8cb5eb64d53080b3fc03 (diff)
downloadbcm5719-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/CodeGen/MIRParser/MIRParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIRParser.cpp11
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;
}
OpenPOWER on IntegriCloud