]> granicus.if.org Git - llvm/commitdiff
[AArch64][RegisterBankInfo] Fix mapping cost for GPR.
authorQuentin Colombet <qcolombet@apple.com>
Mon, 8 May 2017 18:16:23 +0000 (18:16 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Mon, 8 May 2017 18:16:23 +0000 (18:16 +0000)
In r292478, we changed the order of the enum that is referenced by
PMI_FirstXXX. This had the side effect of changing the cost of the
mapping of all the loads, instead of just the FPRs ones.

Reinstate the higher cost for all but GPR loads.
Note: This did not have any external visible effects:
- For Fast mode, the cost would have been higher, but we don't care
  because we don't try to use alternative mappings.
- For Greedy mode, the higher cost of the GPR loads, would have
  triggered the use of the supposedly alternative mapping, that
  would be in fact the same GPR mapping but with a lower cost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302452 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64RegisterBankInfo.cpp

index 5f895903da6f185e5110558740e2e6b2c694224c..a94d9eb6821c731aabefe45a86a7cdb58c3d2650 100644 (file)
@@ -529,7 +529,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
     // for the greedy mode the cost of the cross bank copy will
     // offset this number.
     // FIXME: Should be derived from the scheduling model.
-    if (OpRegBankIdx[0] >= PMI_FirstFPR)
+    if (OpRegBankIdx[0] != PMI_FirstGPR)
       Cost = 2;
     break;
   }