[llvm] [IR] Initial introduction of memset_pattern (PR #97583)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 02:54:00 PDT 2024


bjope wrote:

FWIW, when it comes to regular memset out downstream target (with 16 bit char) is treating the length specifier as "number of chars" (just like it is for targets with 8 bit bytes).
However, we have needed to make the value argument an overloaded type in the intrinsic, to allow using i16 as type for the value. This of course result in multiple downstream diffs all over the place, which always have been a minor annoyance.
Theoretically, in the long run, it would be nice if "memset" just was a subset of "memset.pattern" whit the pattern size matching the byte size. At a glance it seems like memset.pattern might fill the gap, but then all optimizations should deal with byte sized value argument in memset.pattern just as well as ordinary memset. I doubt that it will happen in the near future (or ever).
'm just saying that the existing "llvm.memset" is one of those things that is complicated to handle for certain targets. And it wouldn't hurt if memset.pattern would work well regardless of "size of char"/"bits per byte".

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


More information about the llvm-commits mailing list