[llvm-branch-commits] [llvm] [SDAG] Set InBounds when when computing offsets into memory objects (PR #165425)
Fabian Ritter via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Oct 29 01:17:52 PDT 2025
================
@@ -5626,17 +5626,31 @@ class LLVM_ABI TargetLowering : public TargetLoweringBase {
/// Get a pointer to vector element \p Idx located in memory for a vector of
/// type \p VecVT starting at a base address of \p VecPtr. If \p Idx is out of
/// bounds the returned pointer is unspecified, but will be within the vector
- /// bounds.
- SDValue getVectorElementPointer(SelectionDAG &DAG, SDValue VecPtr, EVT VecVT,
- SDValue Index) const;
+ /// bounds. \p PtrArithFlags can be used to mark that arithmetic within the
+ /// vector in memory is known to not wrap or to be inbounds.
+ SDValue getVectorElementPointer(
+ SelectionDAG &DAG, SDValue VecPtr, EVT VecVT, SDValue Index,
+ const SDNodeFlags PtrArithFlags = SDNodeFlags()) const;
+
+ /// Get a pointer to vector element \p Idx located in memory for a vector of
+ /// type \p VecVT starting at a base address of \p VecPtr. If \p Idx is out of
+ /// bounds the returned pointer is unspecified, but will be within the vector
+ /// bounds. \p VecPtr is guaranteed to point to the beginning of a memory
+ /// location large enough for the vector.
+ SDValue getInboundsVectorElementPointer(SelectionDAG &DAG, SDValue VecPtr,
+ EVT VecVT, SDValue Index) const;
----------------
ritter-x2a wrote:
Probably not, you're right. I went for consistency with the surrounding declarations, but, looking further around in the file, there is precedent for inline definitions as well. Changed.
https://github.com/llvm/llvm-project/pull/165425
More information about the llvm-branch-commits
mailing list