[llvm-commits] [llvm-gcc][arm][patch] Lower function signatures a bit more

Sandeep Patel deeppatel1987 at gmail.com
Wed Sep 8 23:28:05 PDT 2010


If there are no regressions with hard float, LGTM with perhaps some
comments explaining why you're using the TRY_PASS hook and what types
you expect it to apply to.

deep

On Thu, Sep 9, 2010 at 6:01 AM, Rafael Espindola <espindola at google.com> wrote:
> With the recent improvements Chris did to the optimization of shifts I
> thought that an old patch I wrote for PR6059 might have gained some
> extra usefulness. The patch lowers the function signatures a bit more
> so that it is explicit in the IL that the arguments are being split
> into 32 bit chunks. For example, the C code
>
> -------------------------------------------------
> struct foo {double a; int b;};
> void f(int, struct foo);
> void g(int a, double b, int c) {
>  struct foo x = {b, c};
>  f(a, x);
> }
> -------------------------------------------------
>
> Is currently lowered to
>
> --------------------------------
>
> define void @g(i32 %a, double %b, i32 %c) nounwind optsize {
> entry:
>  %tmp11 = bitcast double %b to i64
>  %tmp5 = zext i32 %c to i64
>  tail call void @f(i32 %a, i64 %tmp11, i64 %tmp5) nounwind
>  ret void
> }
>
> declare void @f(i32, i64, i64)
>
> ------------------------------
>
> And with the patch it is lowered to
>
> --------------------------------------------------------------------------------
> define void @g(i32 %a.0, i32, i32 %b.0, i32 %b.1, i32 %c.0) nounwind optsize {
> entry:
>  tail call void @f(i32 %a.0, i32 undef, i32 %b.0, i32 %b.1, i32 %c.0,
> i32 0) nounwind
>  ret void
> }
> declare void @f(i32, i32, i32, i32, i32, i32)
> -----------------------------------------------------------------------------------
>
> I tested with Debian's gcc 4.3.2 compatibility test suite:
>
> make ALT_CC_UNDER_TEST=/home/espindola/llvm-gcc-inst/bin/llvm-gcc
> check-gcc RUNTESTFLAGS="compat.exp"
>
> I understand if there is not a lot of interest in optimizing llvm-gcc.
> I will just try to remember to to check what clang does when I get the
> time to work with it.
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>




More information about the llvm-commits mailing list