[cfe-commits] [llvm-commits] [patch][pr14113] Use inreg in combination with x86_fastcallcc
Eli Friedman
eli.friedman at gmail.com
Tue Oct 23 13:47:03 PDT 2012
On Mon, Oct 22, 2012 at 7:17 PM, Rafael EspĂndola
<rafael.espindola at gmail.com> wrote:
> Rebased patches on top of the recent regparm fix are attached.
no-padding.patch looks fine.
+ if (AI.getPaddingType()) {
+ if (CallingConv == llvm::CallingConv::X86_FastCall) {
+ llvm::AttrBuilder PadAttrs;
+ PadAttrs.addAttribute(llvm::Attributes::InReg);
+
+ llvm::Attributes A =llvm::Attributes::get(getLLVMContext(), PadAttrs);
+ PAL.push_back(llvm::AttributeWithIndex::get(Index, A));
+ }
+ // Increment Index if there is padding.
+ ++Index;
+ }
I really don't like that we're checking for a platform-specific
calling convention in target-independent code. (If you need an extra
flag in the ABIArgInfo to distinguish regular padding and inreg
padding, feel free to add one.)
-Eli
More information about the cfe-commits
mailing list