[llvm] [IR] Update docstring for stripAndAccumulateConstantOffset (PR #180365)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 01:16:51 PST 2026


================
@@ -732,9 +732,10 @@ class Value {
   ///
   /// Note that this function will never return a nullptr. It will also never
   /// manipulate the \p Offset in a way that would not match the difference
-  /// between the underlying value and the returned one. Thus, if no constant
-  /// offset was found, the returned value is the underlying one and \p Offset
-  /// is unchanged.
+  /// between the underlying value and the returned one. Thus, if a variable
+  /// offset was encountered, the returned value is the first traversed value
+  /// to introduce a non-constant offset and \p Offset is the accumulated
----------------
antoniofrighetto wrote:

Maybe slightly rephrased as follows?

```suggestion
  /// between the underlying value and the returned one. Thus, if a variable
  /// offset is encountered during traversal, the returned value is the first
  /// Value that introduces a non-constant offset and \p Offset is the
```

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


More information about the llvm-commits mailing list