[llvm] [Docs][Intrisics] Fix the name of llvm.memset.inline in the documentation (PR #180373)

Nicolas IOOSS via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 8 13:05:19 PST 2026


niooss-ledger wrote:

@boomanaiden154 There are two distinct issues with the name `@llvm.memset.inline.p0.p0i8.i32`:

1. The suffix uses two pointers, whereas the generated code always used a single one. The commit introducing this instrinsic, [commit 38637ee47754 ("[clang] Add support for __builtin_memset_inline") from June 2022](https://github.com/llvm/llvm-project/commit/38637ee477541370a90b37f149069d8e5c0c2efd) added documentation in `‎llvm/docs/LangRef.rst` with `@llvm.memset.inline.p0i8.p0i8.i32` and `@llvm.memset.inline.p0i8.p0i8.i64` but tests with `@llvm.memset.inline.p0i8.i32` and `@llvm.memset.inline.p0i8.i64` (note the difference in the numbers of `.p0i8`). I looked at where this `.p0i8.i32` suffix came from and found that `IRBuilderBase::CreateMemSetInline`  has been using `Type *Tys[] = {Dst->getType(), Size->getType()};` since it was introduced. The relevant code is now: https://github.com/llvm/llvm-project/blob/2078da43e25a4623cab2d0d60decddf709aaea28/llvm/lib/IR/IRBuilder.cpp#L179-L186

2. The name is still using syntax from before opaque pointers (`.p0i8` instead of `.p0`). This change was missed in [commit 7ac7ec820296 ("[LangRef] Update for opaque pointers (NFC)") from July 2022](https://github.com/llvm/llvm-project/commit/7ac7ec820296684cfa25699afe0a7aba25a8b926), which did:

```patch
-      declare void @llvm.memset.inline.p0i8.p0i8.i32(i8* <dest>, i8 <val>,
-                                                     i32 <len>,
-                                                     i1 <isvolatile>)
-      declare void @llvm.memset.inline.p0i8.p0i8.i64(i8* <dest>, i8 <val>,
-                                                     i64 <len>,
-                                                     i1 <isvolatile>)
+      declare void @llvm.memset.inline.p0.p0i8.i32(ptr <dest>, i8 <val>,
+                                                   i32 <len>, i1 <isvolatile>)
+      declare void @llvm.memset.inline.p0.p0.i64(ptr <dest>, i8 <val>,
+                                                 i64 <len>, i1 <isvolatile>)
```

While this Pull Request fixes both issues, it seemed to me that the first one is more important than the second one, so I only mentioned it in the description.

That being said, your review "the description gets the reasoning wrong" hints that either my description was not clear enough, or I am completely wrong regarding the first issue that I am trying to fix. Could you please elaborate?

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


More information about the llvm-commits mailing list