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

Fabian Ritter via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 01:02:05 PDT 2025


================
@@ -468,6 +468,11 @@ class TargetMachine {
     return false;
   }
 
+  /// True if target has some particular form of dealing with pointer arithmetic
+  /// semantics. False if pointer arithmetic should not be preserved for passes
+  /// such as instruction selection, and can fallback to regular arithmetic.
+  virtual bool shouldPreservePtrArith(const Function &F) const { return false; }
----------------
ritter-x2a wrote:

Added with d5f083ed1dadf2cbfa914c8f886059120f8a7ee0 since I don't see harm in adding the pointer's VT if it's used somewhere. We don't currently need it for AMDGPU; my goal there is just to have DAG nodes that [can meaningfully carry an `inbounds` flag](https://github.com/llvm/llvm-project/pull/131862).

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


More information about the llvm-commits mailing list