[IR] Take operand bundles into account for call argument readonly/writeonly
authorNikita Popov <npopov@redhat.com>
Thu, 27 Oct 2022 10:45:08 +0000 (12:45 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 1 Nov 2022 08:30:03 +0000 (09:30 +0100)
commit6aa672f14197e84520671de4ce3fcc724bbfe8d9
treee95cfa2849b92bfc8a99627a4f6ce68a539d511e
parentbcedeefa40a4759c40379d957f38da2b10a14f63
[IR] Take operand bundles into account for call argument readonly/writeonly

We currently only take operand bundle effects into account when
querying the function-level memory attributes. However, I believe
that we also need to do the same for parameter attributes. For
example, a call with deopt bundle to a function with readnone
parameter attribute cannot treat that parameter as readnone,
because the deopt bundle may read it.

Differential Revision: https://reviews.llvm.org/D136834
llvm/lib/IR/Instructions.cpp
llvm/test/Analysis/BasicAA/deoptimize.ll
llvm/test/Transforms/FunctionAttrs/readattrs.ll
llvm/test/Transforms/FunctionAttrs/writeonly.ll