Calls/functions with ArgMemOnly only access memory via pointer-type
arguments. If all pointer-type arguments are WriteOnly, this means that
the function does not read memory.
This is relevant, for example, for the current definition of
@llvm.memset, which is marked as ArgMemOnly with WriteOnly pointers arguments.
Without this patch, doesNotReadMemory returns false for @llvm.memset.
I am not sure where the best place to add tests for this would be?
This impacts a single attributor test, which uses the following
declare <4 x i32> @test11_1(<4 x i32*>) argmemonly nounwind readonly
With the patch, this function will be treated as readnone. I think that
is fine according to the ArgMemOnly definition: there are no
pointer-typed arguments (the only argument is a vector of pointers), so
no memory can be accessed.
If 'pointer-typed arguments' could be interpreted as any argument containing a
pointer, this patch would have to be more careful with checking the arguments.