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

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sat May 24 11:53:33 PDT 2025


s-barannikov 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);
> }
> ```

I looked for it three times =\


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


More information about the llvm-commits mailing list