[LLVMdev] Two new 'llvmnotes'

Chris Lattner sabre at nondot.org
Wed May 7 14:24:25 PDT 2008


On Wed, 7 May 2008, Matthijs Kooijman wrote:
>> Byval and passing a first class aggregate have the same semantics.
>> However, byval is very efficient for large aggregates and first-class
>> aggregates is efficient for small ones.
> I was making the assumption that having the same semantics actually means
> being equivalent and thus resulting in the same generated code. Since, AFAICS,
> the LLVM IR mainly conveys semantics, what do both ways of writing this imply
> for the generated code, then?

'byval' is address exposed in the IR, and is thus living in memory.  First 
class aggregates are not address exposed.  Think of them as being 
implicitly scalarized to their elements with each element held in 
registers.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list