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

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 06:20:56 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
----------------
arichardson wrote:

I'm not sure we need this comment here, the git blame commit message should have all that information. We don't so this for other changes that came from other downstream forks.

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


More information about the llvm-commits mailing list