[llvm] r282960 - [AArch64][RegisterBankInfo] Rename getValueMappingIdx to getValueMapping

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 14:46:20 PDT 2016


Author: qcolombet
Date: Fri Sep 30 16:46:19 2016
New Revision: 282960

URL: http://llvm.org/viewvc/llvm-project?rev=282960&view=rev
Log:
[AArch64][RegisterBankInfo] Rename getValueMappingIdx to getValueMapping

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

NFC.

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64GenRegisterBankInfo.def
    llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64GenRegisterBankInfo.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64GenRegisterBankInfo.def?rev=282960&r1=282959&r2=282960&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64GenRegisterBankInfo.def (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64GenRegisterBankInfo.def Fri Sep 30 16:46:19 2016
@@ -101,7 +101,7 @@ RegisterBankInfo::ValueMapping ValMappin
 ///
 /// \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)) *

Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp?rev=282960&r1=282959&r2=282960&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp Fri Sep 30 16:46:19 2016
@@ -246,12 +246,12 @@ AArch64RegisterBankInfo::getInstrAlterna
     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
         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
   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;




More information about the llvm-commits mailing list