[PATCH] D158081: [IR] Add writable attribute
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 22 18:38:21 PDT 2023
jdoerfert added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:8107
A.removeAttrs(getIRPosition(), AttrKinds);
+ // FIXME: Remove writable attribute if necessary.
return A.manifestAttrs(getIRPosition(),
----------------
nikic wrote:
> jdoerfert wrote:
> > nikic wrote:
> > > @jdoerfert What would be the correct way to remove an attribute from all parameters here?
> > >
> > > In practice just the handling above seems to be enough, but it would be cleaner to explicitly remove writable if we infer readonly here.
> > You can just add it to `AttrKinds` that is passed to `removeAttrs`, no?
> The problem is that Memory is a function attribute, while Writable is a parameter attribute, so I think the getIRPosition() would be the wrong one for it?
Oh, then u need to iterate over all arguments I guess. Not that we forbid `readnone` on the function and `writeonly` on an argument right now.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158081/new/
https://reviews.llvm.org/D158081
More information about the llvm-commits
mailing list