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

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 09:20:49 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; }
----------------
jrtc27 wrote:

Can this please include the pointer type being operated on? For CHERI we don't want to add PTRADD for integers if the target doesn't otherwise use them, only for capabilities.

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


More information about the llvm-commits mailing list