[PATCH] D158081: [IR] Add writable attribute

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 14:29:34 PDT 2023


nikic 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(),
----------------
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?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158081/new/

https://reviews.llvm.org/D158081



More information about the llvm-commits mailing list