[llvm] [IR] Initial introduction of memset_pattern (PR #97583)
Alex Bradbury via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 03:26:19 PDT 2024
asb wrote:
> > 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).
>
> An alternative we should probably consider here is to not have a separate memset.pattern at all, and instead have memset be memset.pattern. If we're going to add a type overload to memset anyway for non-8-bit targets, there's probably not a lot of point to having a separate memset.pattern?
I agree unifying could make sense in the future and could be done either by increasing the scope of memset.pattern to subsume memset, or by modifying memset so it subsumes memset.pattern. Are you happy to defer this to the future or do you see implementing such a unification as a blocker for this initial introduction? My assumption so far has been that introducing this intrinsic as an incremental step is likely better due to being non-invasive to existing users and frontends, even if we later modify memset to make memset.pattern redundant.
https://github.com/llvm/llvm-project/pull/97583
More information about the llvm-commits
mailing list