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

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 05:26:51 PST 2023


================
@@ -1110,6 +1142,24 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexed(SDValue N, unsigned Size,
         OffImm = CurDAG->getTargetConstant(RHSC >> Scale, dl, MVT::i64);
         return true;
       }
+
+      // Perfer [Reg + imm] mode.
+      //     ADD  BaseReg, WideImmediate & 0x0fff000
+      //     LDR  X2, [BaseReg, WideImmediate & 0x0fff]
+      SDValue LHS = N.getOperand(0);
+      if (isPreferredBaseAddrMode(RHSC)) {
----------------
davemgreen wrote:

I think there needs to be a check for Scale here too.

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


More information about the llvm-commits mailing list