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

Fabian Ritter via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 06:26:52 PDT 2025


================
@@ -2617,6 +2620,85 @@ SDValue DAGCombiner::foldSubToAvg(SDNode *N, const SDLoc &DL) {
   return SDValue();
 }
 
+/// Try to fold a pointer arithmetic node.
+/// This needs to be done separately from normal addition, because pointer
+/// addition is not commutative.
+/// This function was adapted from DAGCombiner::visitPTRADD() from the Morello
----------------
ritter-x2a wrote:

[Removed.](https://github.com/llvm/llvm-project/pull/140017/commits/f6a4cda119e7825a571b24feaa21223a86103d15)

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


More information about the llvm-commits mailing list