[AArch64][RegisterBankInfo] Rename getValueMappingIdx to getValueMapping

We don't return index, we return the actual ValueMapping.

NFC.

llvm-svn: 282960
This commit is contained in:
Quentin Colombet 2016-09-30 21:46:19 +00:00
parent b4afac7b32
commit 7c3fa8e361
2 changed files with 11 additions and 9 deletions

View File

@ -101,7 +101,7 @@ RegisterBankInfo::ValueMapping ValMappings[] {
///
/// \pre \p RBIdx != PartialMappingIdx::None
const RegisterBankInfo::ValueMapping *
getValueMappingIdx(PartialMappingIdx RBIdx, unsigned Size) {
getValueMapping(PartialMappingIdx RBIdx, unsigned Size) {
assert(RBIdx != PartialMappingIdx::None && "No mapping needed for that");
unsigned ValMappingIdx = First3OpsIdx +
(RBIdx + getRegBankBaseIdxOffset(Size)) *

View File

@ -246,12 +246,12 @@ AArch64RegisterBankInfo::getInstrAlternativeMappings(
if (MI.getNumOperands() != 3)
break;
InstructionMappings AltMappings;
InstructionMapping GPRMapping(/*ID*/ 1, /*Cost*/ 1,
getValueMappingIdx(AArch64::FirstGPR, Size),
/*NumOperands*/ 3);
InstructionMapping FPRMapping(/*ID*/ 2, /*Cost*/ 1,
getValueMappingIdx(AArch64::FirstFPR, Size),
/*NumOperands*/ 3);
InstructionMapping GPRMapping(
/*ID*/ 1, /*Cost*/ 1, AArch64::getValueMapping(AArch64::FirstGPR, Size),
/*NumOperands*/ 3);
InstructionMapping FPRMapping(
/*ID*/ 2, /*Cost*/ 1, AArch64::getValueMapping(AArch64::FirstFPR, Size),
/*NumOperands*/ 3);
AltMappings.emplace_back(std::move(GPRMapping));
AltMappings.emplace_back(std::move(FPRMapping));
@ -352,7 +352,8 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
IsFPR ? AArch64::FirstFPR : AArch64::FirstGPR;
return InstructionMapping{DefaultMappingID, 1,
getValueMappingIdx(RBIdx, Size), NumOperands};
AArch64::getValueMapping(RBIdx, Size),
NumOperands};
}
default:
break;
@ -405,7 +406,8 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
SmallVector<const ValueMapping *, 8> OpdsMapping(NumOperands);
for (unsigned Idx = 0; Idx < NumOperands; ++Idx)
if (MI.getOperand(Idx).isReg())
OpdsMapping[Idx] = getValueMappingIdx(OpRegBankIdx[Idx], OpSize[Idx]);
OpdsMapping[Idx] =
AArch64::getValueMapping(OpRegBankIdx[Idx], OpSize[Idx]);
Mapping.setOperandsMapping(getOperandsMapping(OpdsMapping));
return Mapping;