[LLVMdev] Question about 'byval'

Duncan Sands baldrick at free.fr
Mon Sep 13 01:52:35 PDT 2010


Hi Yuan,

> Hello, I am seeking a clarification of the semantics of ‘byval’ parameter
> attribute in llvm IR.

none of the explicit copies you see are needed.  On x86 and x86-64, the latest
llvm-gcc does not create any explicit copies in the LLVM IR.  The code generator
introduces a copy because of the 'byval' attribute (at -O0 and -O1; at -O2 and
above that copy is removed too).

Ciao,

Duncan.



More information about the llvm-dev mailing list