]> granicus.if.org Git - llvm/commitdiff
[AArch64][RegisterBankInfo] Bump the cost of vector loads.
authorQuentin Colombet <qcolombet@apple.com>
Thu, 13 Oct 2016 00:11:59 +0000 (00:11 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Thu, 13 Oct 2016 00:11:59 +0000 (00:11 +0000)
This does not change anything yet, because we do not offer any
alternative mapping.

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

lib/Target/AArch64/AArch64RegisterBankInfo.cpp

index 69ba5023f939e39183cbf41ba9c24cdc629892bf..298e697df909c848b63d8fe506cec65925b1ce3f 100644 (file)
@@ -431,6 +431,16 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
                    *AArch64::PartMappings[OpRegBankIdx[1]].RegBank, OpSize[0]);
     break;
   }
+  case TargetOpcode::G_LOAD: {
+    // Loading in vector unit is slightly more expensive.
+    // This is actually only true for the LD1R and co instructions,
+    // but anyway for the fast mode this number does not matter and
+    // 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] >= AArch64::FirstFPR)
+      Cost = 2;
+  }
   }
 
   // Finally construct the computed mapping.