@@ -216,7 +216,7 @@ AArch64RegisterBankInfo::AArch64RegisterBankInfo(
216216
217217unsigned AArch64RegisterBankInfo::copyCost (const RegisterBank &A,
218218 const RegisterBank &B,
219- unsigned Size) const {
219+ TypeSize Size) const {
220220 // What do we do with different size?
221221 // copy are same size.
222222 // Will introduce other hooks for different size:
@@ -340,12 +340,16 @@ AArch64RegisterBankInfo::getInstrAlternativeMappings(
340340 /* NumOperands*/ 2 );
341341 const InstructionMapping &GPRToFPRMapping = getInstructionMapping (
342342 /* ID*/ 3 ,
343- /* Cost*/ copyCost (AArch64::GPRRegBank, AArch64::FPRRegBank, Size),
343+ /* Cost*/
344+ copyCost (AArch64::GPRRegBank, AArch64::FPRRegBank,
345+ TypeSize::Fixed (Size)),
344346 getCopyMapping (AArch64::FPRRegBankID, AArch64::GPRRegBankID, Size),
345347 /* NumOperands*/ 2 );
346348 const InstructionMapping &FPRToGPRMapping = getInstructionMapping (
347349 /* ID*/ 3 ,
348- /* Cost*/ copyCost (AArch64::GPRRegBank, AArch64::FPRRegBank, Size),
350+ /* Cost*/
351+ copyCost (AArch64::GPRRegBank, AArch64::FPRRegBank,
352+ TypeSize::Fixed (Size)),
349353 getCopyMapping (AArch64::GPRRegBankID, AArch64::FPRRegBankID, Size),
350354 /* NumOperands*/ 2 );
351355
@@ -709,7 +713,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
709713 assert (DstRB && SrcRB && " Both RegBank were nullptr" );
710714 unsigned Size = getSizeInBits (DstReg, MRI, TRI);
711715 return getInstructionMapping (
712- DefaultMappingID, copyCost (*DstRB, *SrcRB, Size),
716+ DefaultMappingID, copyCost (*DstRB, *SrcRB, TypeSize::Fixed ( Size) ),
713717 getCopyMapping (DstRB->getID (), SrcRB->getID (), Size),
714718 // We only care about the mapping of the destination.
715719 /* NumOperands*/ 1 );
@@ -728,7 +732,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
728732 const RegisterBank &SrcRB =
729733 SrcIsGPR ? AArch64::GPRRegBank : AArch64::FPRRegBank;
730734 return getInstructionMapping (
731- DefaultMappingID, copyCost (DstRB, SrcRB, Size),
735+ DefaultMappingID, copyCost (DstRB, SrcRB, TypeSize::Fixed ( Size) ),
732736 getCopyMapping (DstRB.getID (), SrcRB.getID (), Size),
733737 // We only care about the mapping of the destination for COPY.
734738 /* NumOperands*/ Opc == TargetOpcode::G_BITCAST ? 2 : 1 );
@@ -821,7 +825,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
821825 Cost = copyCost (
822826 *AArch64GenRegisterBankInfo::PartMappings[OpRegBankIdx[0 ]].RegBank ,
823827 *AArch64GenRegisterBankInfo::PartMappings[OpRegBankIdx[1 ]].RegBank ,
824- OpSize[0 ]);
828+ TypeSize::Fixed ( OpSize[0 ]) );
825829 break ;
826830 case TargetOpcode::G_LOAD: {
827831 // Loading in vector unit is slightly more expensive.
0 commit comments