[PATCH] D62319: IR: add 'size <N>' attribute to 'byval' function parameters

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 09:04:36 PDT 2019


t.p.northover added a comment.

> One of the other suggestions was to pass a _type_ as a parameter to byval. IMO that would be the nicest idea (but I don't know if it's infeasibly difficult?)

I wouldn't worry about the implementation difficulty, I can see a pretty clear path there. I also like the spelling of that option, it certainly bypasses the ambiguity of a bare number. I wonder if it's promising more than we actually deliver though. SelectionDAG only exposes the size and alignment to backends.

A final point in favour of the type idea is that I think targets where pointers are special (e.g. CHERI where a pointer in memory is only usable if it was stored by a special, blessed instruction) couldn't work with a plain size. They don't work with SelectionDAG either but in future they might want to use byval. I'm not entirely sure how theoretical that argument is though.


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

https://reviews.llvm.org/D62319





More information about the llvm-commits mailing list