<div dir="ltr">This was brought up on IRC the other day & I've been tossing it around a bit.<br><br>Roughly, I think it makes sense to move the pointee type to the byval attribute:<br><br>  %struct.foo* byval %x<br>to<br>  ptr byval(%struct.foo) %x<br><br>but looking at the code I'm not quite sure how to go about it. There currently appear to be enum attributes (anything well typed in the IR, essentially?), integer attributes (well typed enum attributes with an integer parameter (align 4, dereferenceable 8, etc)) and string attributes (untyped in the IR - for target specific features).<br><br>The quirk of interest is that it seems integer attributes can all be multiply specified (align 4 align 8 and dereferenceable 8 dereferenceable 3) - I'm not sure what this actually means (do we take the max? I assume we do), but when I reached the Attribute sorting code it looks like it treats these as distinct attributes at least and I wasn't sure if/how to cope with this for a type attribute - should they be ordered (are Types orderable?)? or should we be doing some kind of deduplication earlier on and say that there's only one byval attribute (if I'm adding that machinery, should we apply it to align, dereferencable, etc - I guess they get coalesced /somewhere/ at least).<br></div>