[llvm] [IR] Add MemsetPatternInst to the MemIntrinsic hierarchy (PR #153301)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 07:58:52 PDT 2025


preames wrote:

> `MemIntrinsicBase::getLength` for `memset.pattern` doesn't return the number of bytes to be written. Can we refactor the interface to provide a u64 scale factor?

My tentative plan was to have length be "length in elements", and then use the element type to get the element size.  (For everything except memset.pattern, element type is always i8.)  This change doesn't need the distinction as all users (not guarded) are doing zero checks in which case the scale doesn't matter.  You okay if I defer this API design to a patch which needs to reason about the length in bytes?  Or would you rather I speculative add it now?

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


More information about the llvm-commits mailing list