[llvm] [AArch64] Add CodeGen support for FEAT_CPA (PR #105669)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 09:31:10 PDT 2024


================
@@ -4069,8 +4069,14 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
     else
       Index = DAG.getNode(ISD::MUL, dl, Index.getValueType(), Index,
                           DAG.getConstant(EntrySize, dl, Index.getValueType()));
-    SDValue Addr = DAG.getNode(ISD::ADD, dl, Index.getValueType(),
-                               Index, Table);
+    SDValue Addr;
+    if (!DAG.getTarget().shouldPreservePtrArith(
+            DAG.getMachineFunction().getFunction())) {
+      Addr = DAG.getNode(ISD::ADD, dl, Index.getValueType(), Index, Table);
----------------
arichardson wrote:

Keep the order the same and use `getMemBasePlusOffset`?

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


More information about the llvm-commits mailing list