[llvm] [AArch64] merge index address with large offset into base address (PR #75343)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 19:21:35 PST 2023


================
@@ -722,6 +781,40 @@ static bool isMergeableLdStUpdate(MachineInstr &MI) {
   }
 }
 
+// Make sure this is a reg+reg Ld/St
+static bool isMergeableIndexLdSt(MachineInstr &MI, int &Scale) {
+  unsigned Opc = MI.getOpcode();
+  switch (Opc) {
+  default:
+    return false;
+  // Scaled instructions.
+  // TODO: Add more index address stores.
+  case AArch64::LDRBroX:
+  case AArch64::LDRBBroX:
+  case AArch64::LDRSBXroX:
+  case AArch64::LDRSBWroX:
+    Scale = 1;
+    return true;
+  case AArch64::LDRHroX:
+  case AArch64::LDRHHroX:
+  case AArch64::LDRSHXroX:
+  case AArch64::LDRSHWroX:
+    Scale = 2;
+    return true;
+  case AArch64::LDRWroX:
+  case AArch64::LDRSWroX:
----------------
vfdff wrote:

Apply your comment, thanks

https://github.com/llvm/llvm-project/pull/75343


More information about the llvm-commits mailing list