[llvm] [SelectionDAG] Introduce ISD::PTRADD (PR #140017)
Fabian Ritter via llvm-commits
llvm-commits at lists.llvm.org
Fri May 16 01:19:10 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.
----------------
ritter-x2a wrote:
Unless we add a DAGCombine that replaces ptradd with add (which would need a similar option to disable for backends that want to handle ptradd properly), modifying existing backends to use ptradd without causing regressions is a significant effort (that's at least my experience from working on it for AMDGPU).
Should I add an "This should be removed when PTRADD nodes are widely supported by backends." comment to the function?
https://github.com/llvm/llvm-project/pull/140017
More information about the llvm-commits
mailing list