The heart of this change is an NFC which removes dedicated handling in AST for handling mem* intrinsics in favour of the recently added generic argmemonly handling.
However, doing this exposed two deeper issues which are definitely not NFC:
- We'd never sunk the handling for the atomic.elementwise variants down into MemoryLocation (which is the codepath used by the generic argmemonly work)
- We weren't treating memmove as being writeonly in it's first argument. This is really the change which concerns me. (Note: memmove allows aliasing src and dest, but that doesn't allow the we can read *through* the dest argument which is how the parameter attributes are specified.)
Together, these two make the change mildly risky and I figured an extra set or two of eyes was definitely warranted.
Realized I'd missed the atomic memset case. I added new tests (in test/Analysis/AliasSet/memset.ll) which would have caught this and will rebase at some point.