[llvm-commits] [PATCH] Add va_argpack intrinsics

Benjamin Kramer benny.kra at googlemail.com
Tue May 15 08:08:14 PDT 2012


This will be used to implement __builtin_va_arg_pack[len] in clang (PR7219).

Since this is used to model a pretty crazy gcc extension (used by glibc) we have
to expand the intrinsics in the inliner. When it replaces a vararg call site with
a copy of the function another pass over all instructions is performed which
replaces any pack intrinsics with the values from the call site. There are some
rather narrow requirements where the intrinsics can occur, documented in LangRef
and enforced by the verifier.

This patch has two other side effects:
- DAE is not allowed to remove varargs if a va_pack intrinsic is used.
- Inliner can now inline vararg functions iff they don't use va_start. This can
  happen if DAE doesn't remove the varargs because there is a va_pack intrinsic
  or if the AlwaysInliner tries to inline the function.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-va_pack-and-va_packlen-intrinsic.patch
Type: application/octet-stream
Size: 16426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120515/56dc4e9e/attachment.obj>


More information about the llvm-commits mailing list