diff --git a/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp index e10ed0af659ed..a9908abf64237 100644 --- a/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp +++ b/llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp @@ -32,39 +32,39 @@ const RegisterBankInfo::PartialMapping PartMappings[] = { }; enum PartialMappingIdx { - PMI_GPR32 = 0, - PMI_GPR64 = 1, - PMI_FPR32 = 2, - PMI_FPR64 = 3, + PMI_GPRB32 = 0, + PMI_GPRB64 = 1, + PMI_FPRB32 = 2, + PMI_FPRB64 = 3, }; const RegisterBankInfo::ValueMapping ValueMappings[] = { // Invalid value mapping. {nullptr, 0}, // Maximum 3 GPR operands; 32 bit. - {&PartMappings[PMI_GPR32], 1}, - {&PartMappings[PMI_GPR32], 1}, - {&PartMappings[PMI_GPR32], 1}, + {&PartMappings[PMI_GPRB32], 1}, + {&PartMappings[PMI_GPRB32], 1}, + {&PartMappings[PMI_GPRB32], 1}, // Maximum 3 GPR operands; 64 bit. - {&PartMappings[PMI_GPR64], 1}, - {&PartMappings[PMI_GPR64], 1}, - {&PartMappings[PMI_GPR64], 1}, + {&PartMappings[PMI_GPRB64], 1}, + {&PartMappings[PMI_GPRB64], 1}, + {&PartMappings[PMI_GPRB64], 1}, // Maximum 3 FPR operands; 32 bit. - {&PartMappings[PMI_FPR32], 1}, - {&PartMappings[PMI_FPR32], 1}, - {&PartMappings[PMI_FPR32], 1}, + {&PartMappings[PMI_FPRB32], 1}, + {&PartMappings[PMI_FPRB32], 1}, + {&PartMappings[PMI_FPRB32], 1}, // Maximum 3 FPR operands; 64 bit. - {&PartMappings[PMI_FPR64], 1}, - {&PartMappings[PMI_FPR64], 1}, - {&PartMappings[PMI_FPR64], 1}, + {&PartMappings[PMI_FPRB64], 1}, + {&PartMappings[PMI_FPRB64], 1}, + {&PartMappings[PMI_FPRB64], 1}, }; enum ValueMappingsIdx { InvalidIdx = 0, - GPR32Idx = 1, - GPR64Idx = 4, - FPR32Idx = 7, - FPR64Idx = 10, + GPRB32Idx = 1, + GPRB64Idx = 4, + FPRB32Idx = 7, + FPRB64Idx = 10, }; } // namespace RISCV } // namespace llvm @@ -105,7 +105,7 @@ RISCVRegisterBankInfo::getRegBankFromRegClass(const TargetRegisterClass &RC, static const RegisterBankInfo::ValueMapping *getFPValueMapping(unsigned Size) { assert(Size == 32 || Size == 64); - unsigned Idx = Size == 64 ? RISCV::FPR64Idx : RISCV::FPR32Idx; + unsigned Idx = Size == 64 ? RISCV::FPRB64Idx : RISCV::FPRB32Idx; return &RISCV::ValueMappings[Idx]; } @@ -129,7 +129,8 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { unsigned NumOperands = MI.getNumOperands(); const ValueMapping *GPRValueMapping = - &RISCV::ValueMappings[GPRSize == 64 ? RISCV::GPR64Idx : RISCV::GPR32Idx]; + &RISCV::ValueMappings[GPRSize == 64 ? RISCV::GPRB64Idx + : RISCV::GPRB32Idx]; const ValueMapping *OperandsMapping = GPRValueMapping; switch (Opc) {