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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 01:01:15 PDT 2025


================
@@ -469,9 +470,13 @@ class TargetMachine {
   }
 
   /// 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; }
+  /// semantics for pointers with the given value type. 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 EVT &PtrVT) const {
----------------
arsenm wrote:

EVT should be passed by value. But also I don't see how this can be an EVT and not the original IR type (or just PointerType)

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


More information about the llvm-commits mailing list