[llvm-commits] [patch][pr14113] Use inreg in combination with x86_fastcallcc

Eli Friedman eli.friedman at gmail.com
Thu Oct 18 16:29:52 PDT 2012


On Thu, Oct 18, 2012 at 11:16 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> Turns out that references should also go in registers. An updated
> clang patch is attached. The llvm side stays the same.
>
> On 18 October 2012 10:42, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
>> If a argument to a fastcall function should be passed in registers or
>> not depends on the original C type, but both "int x" and "struct {int
>> x;}" become just an i32 llvm argument. I think the best way to solve
>> this is to do what we do for the regparm attribute and use inreg to
>> mark the arguments that should go in registers.
>>
>> The attached patches implement that. Are they OK?

(Note to anyone else reviewing: don't compare against gcc 4.2; gcc's
behavior changed in 4.3.)

Please add a testcase for something like "void bar5(struct S2 y, int
z) {}", with S2 from your testcase.  Please add a testcase with an
argument which is a C++ struct with a non-trivial copy constructor.
Please add testcases involving sret.

This change is going to break any other sources of IR which expect the
current behavior of x86_fastcall; at the very least, please start a
thread on llvmdev so this doesn't surprise anyone.

-Eli




More information about the llvm-commits mailing list