[llvm-commits] PATCH: llvm-gcc option to emit "va_arg" instruction

David Meyer pdox at google.com
Mon Oct 11 21:34:40 PDT 2010


Chris,

That's an easy to change to make. The bulk of the patch is not about the
flag, but about transforming __builtin_va_arg to VAArgInst.

However, as far as I know, there are no targets for which the backend va_arg
implementation is production-worthy. Currently, Clang has custom va_arg
emission for X86-32, X86-64, PIC16, and ARM, while llvm-gcc never emits the
va_arg instruction. As a result, va_arg on most targets is still untested
and potentially incomplete. (I don't think structure passing works on any
targets).

The flag will help facilitate testing of the backend va_arg implementations,
especially X86-64.

(FYI, I have also submitted an initial X86-64 va_arg implementation for
review. This implementation is not complete, but it works for the basic
types. See
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20101004/109404.html).
In
comparison, the complete implementation of X86-64 va_arg in Clang is 1300
lines.

Thanks,
- David M


On Mon, Oct 11, 2010 at 4:11 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Oct 11, 2010, at 7:44 AM, David Meyer wrote:
>
> I discovered I was missing some #ifdef's.
>
> New patch is attached.
>
> Updated visual at: http://codereview.chromium.org/3694002/show
>
>
> Hi David,
>
> I haven't looked at the patch, but I'm not in favor of this.  Having
> llvm-gcc generate the va_arg instruction (on targets where it works) is
> goodness, but we shouldn't add a user-visible knob for it.  We should just
> *always* generate it on those targets.
>
> -Chris
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101011/4ce460a8/attachment.html>


More information about the llvm-commits mailing list