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

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 10:28:42 PST 2025


================
@@ -8061,10 +8062,20 @@ SDValue SelectionDAG::getMemBasePlusOffset(SDValue Base, TypeSize Offset,
 
 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Ptr, SDValue Offset,
                                            const SDLoc &DL,
-                                           const SDNodeFlags Flags) {
+                                           const SDNodeFlags Flags,
+                                           const bool Inverted) {
   assert(Offset.getValueType().isInteger());
   EVT BasePtrVT = Ptr.getValueType();
-  return getNode(ISD::ADD, DL, BasePtrVT, Ptr, Offset, Flags);
+  if (!this->getTarget().shouldPreservePtrArith(
+          this->getMachineFunction().getFunction())) {
+    return getNode(ISD::ADD, DL, BasePtrVT, Ptr, Offset, Flags);
+  } else {
+    if (Inverted) {
----------------
arichardson wrote:

I am not keen on this inverted flag - I will work on fixing all tests that needs this.

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


More information about the llvm-commits mailing list