[llvm] [SelectionDAG] Introduce ISD::PTRADD (PR #140017)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 09:15:42 PDT 2025


topperc wrote:

> This patch adds more calls to `getMemBasePlusOffset()`, but the method wasn't updated to generate `ISD::PTRADD`, is this intended?

Wasn't it updated here?

```
SDValue SelectionDAG::getMemBasePlusOffset(SDValue Ptr, SDValue Offset,
                                           const SDLoc &DL,
                                           const SDNodeFlags Flags) {
  assert(Offset.getValueType().isInteger());
  EVT BasePtrVT = Ptr.getValueType();
  if (TLI->shouldPreservePtrArith(this->getMachineFunction().getFunction(),
                                  BasePtrVT))
    return getNode(ISD::PTRADD, DL, BasePtrVT, Ptr, Offset, Flags);
  return getNode(ISD::ADD, DL, BasePtrVT, Ptr, Offset, Flags);
}
```

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


More information about the llvm-commits mailing list