mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Remove an argument-less call to getSubtargetImpl from TargetLoweringBase.
This required plumbing a TargetRegisterInfo through computeRegisterProperties and into findRepresentativeClass which uses it for register class iteration. This required passing a subtarget into a few target specific initializations of TargetLowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1144,10 +1144,9 @@ TargetLoweringBase::emitPatchPoint(MachineInstr *MI,
|
||||
|
||||
/// findRepresentativeClass - Return the largest legal super-reg register class
|
||||
/// of the register class for the specified type and its associated "cost".
|
||||
std::pair<const TargetRegisterClass*, uint8_t>
|
||||
TargetLoweringBase::findRepresentativeClass(MVT VT) const {
|
||||
const TargetRegisterInfo *TRI =
|
||||
getTargetMachine().getSubtargetImpl()->getRegisterInfo();
|
||||
std::pair<const TargetRegisterClass *, uint8_t>
|
||||
TargetLoweringBase::findRepresentativeClass(const TargetRegisterInfo *TRI,
|
||||
MVT VT) const {
|
||||
const TargetRegisterClass *RC = RegClassForVT[VT.SimpleTy];
|
||||
if (!RC)
|
||||
return std::make_pair(RC, 0);
|
||||
@ -1173,7 +1172,8 @@ TargetLoweringBase::findRepresentativeClass(MVT VT) const {
|
||||
|
||||
/// computeRegisterProperties - Once all of the register classes are added,
|
||||
/// this allows us to compute derived properties we expose.
|
||||
void TargetLoweringBase::computeRegisterProperties() {
|
||||
void TargetLoweringBase::computeRegisterProperties(
|
||||
const TargetRegisterInfo *TRI) {
|
||||
static_assert(MVT::LAST_VALUETYPE <= MVT::MAX_ALLOWED_VALUETYPE,
|
||||
"Too many value types for ValueTypeActions to hold!");
|
||||
|
||||
@ -1355,7 +1355,7 @@ void TargetLoweringBase::computeRegisterProperties() {
|
||||
for (unsigned i = 0; i != MVT::LAST_VALUETYPE; ++i) {
|
||||
const TargetRegisterClass* RRC;
|
||||
uint8_t Cost;
|
||||
std::tie(RRC, Cost) = findRepresentativeClass((MVT::SimpleValueType)i);
|
||||
std::tie(RRC, Cost) = findRepresentativeClass(TRI, (MVT::SimpleValueType)i);
|
||||
RepRegClassForVT[i] = RRC;
|
||||
RepRegClassCostForVT[i] = Cost;
|
||||
}
|
||||
|
Reference in New Issue
Block a user