diff options
author | Reid Kleckner <rnk@google.com> | 2016-05-02 17:41:07 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-05-02 17:41:07 +0000 |
commit | 0404605dda562b3ba70030014c838f7209e05342 (patch) | |
tree | 6bfdf564c0bf103c5643e966004fea9527e2b406 /clang/test/CodeGen | |
parent | 1f520e5c98a0fbeaa1347ea1e58a3f58721ae98c (diff) | |
download | bcm5719-llvm-0404605dda562b3ba70030014c838f7209e05342.tar.gz bcm5719-llvm-0404605dda562b3ba70030014c838f7209e05342.zip |
Expand aggregate arguments more often on 32-bit Windows
Before this change, we would pass all non-HFA record arguments on
Windows with byval. Byval often blocks optimizations and results in bad
code generation. Windows now uses the existing workaround that other
x86_32 platforms use.
I also expanded the workaround to handle C++ records with constructors
on Windows. On non-Windows platforms, we have to keep generating the
same LLVM IR prototypes if we want our bitcode to be ABI compatible.
Otherwise we will encounter mismatch issues like PR21573.
Essentially fixes PR27522 in Clang instead of LLVM.
Reviewers: hans
Differential Revision: http://reviews.llvm.org/D19756
llvm-svn: 268261
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r-- | clang/test/CodeGen/vectorcall.c | 4 | ||||
-rw-r--r-- | clang/test/CodeGen/windows-struct-abi.c | 6 | ||||
-rw-r--r-- | clang/test/CodeGen/x86_32-arguments-win32.c | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/clang/test/CodeGen/vectorcall.c b/clang/test/CodeGen/vectorcall.c index 9ee35b1a02b..b38d5e5fbc5 100644 --- a/clang/test/CodeGen/vectorcall.c +++ b/clang/test/CodeGen/vectorcall.c @@ -9,9 +9,9 @@ void __vectorcall v2(char a, char b) {} // CHECK: define x86_vectorcallcc void @"\01v2@@8"(i8 inreg signext %a, i8 inreg signext %b) // X64: define x86_vectorcallcc void @"\01v2@@16"(i8 %a, i8 %b) -struct Small { int a; }; +struct Small { int x; }; void __vectorcall v3(int a, struct Small b, int c) {} -// CHECK: define x86_vectorcallcc void @"\01v3@@12"(i32 inreg %a, %struct.Small* byval align 4 %b, i32 inreg %c) +// CHECK: define x86_vectorcallcc void @"\01v3@@12"(i32 inreg %a, i32 %b.0, i32 inreg %c) // X64: define x86_vectorcallcc void @"\01v3@@24"(i32 %a, i32 %b.coerce, i32 %c) struct Large { int a[5]; }; diff --git a/clang/test/CodeGen/windows-struct-abi.c b/clang/test/CodeGen/windows-struct-abi.c index 4b4a6f1b5db..1631f61db90 100644 --- a/clang/test/CodeGen/windows-struct-abi.c +++ b/clang/test/CodeGen/windows-struct-abi.c @@ -10,7 +10,7 @@ struct f1 return_f1(void) { while (1); } void receive_f1(struct f1 a0) { } -// CHECK: define void @receive_f1(%struct.f1* byval align 4 %a0) +// CHECK: define void @receive_f1(float %a0.0) struct f2 { float f; @@ -23,7 +23,7 @@ struct f2 return_f2(void) { while (1); } void receive_f2(struct f2 a0) { } -// CHECK: define void @receive_f2(%struct.f2* byval align 4 %a0) +// CHECK: define void @receive_f2(float %a0.0, float %a0.1) struct f4 { float f; @@ -38,5 +38,5 @@ struct f4 return_f4(void) { while (1); } void receive_f4(struct f4 a0) { } -// CHECK: define void @receive_f4(%struct.f4* byval align 4 %a0) +// CHECK: define void @receive_f4(float %a0.0, float %a0.1, float %a0.2, float %a0.3) diff --git a/clang/test/CodeGen/x86_32-arguments-win32.c b/clang/test/CodeGen/x86_32-arguments-win32.c index f8b09957b36..7b27fc74647 100644 --- a/clang/test/CodeGen/x86_32-arguments-win32.c +++ b/clang/test/CodeGen/x86_32-arguments-win32.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -w -triple i386-pc-win32 -emit-llvm -o - %s | FileCheck %s // CHECK-LABEL: define i64 @f1_1() -// CHECK-LABEL: define void @f1_2(%struct.s1* byval align 4 %a0) +// CHECK-LABEL: define void @f1_2(i32 %a0.0, i32 %a0.1) struct s1 { int a; int b; @@ -31,7 +31,7 @@ struct s4 { struct s4 f4_1(void) { while (1) {} } // CHECK-LABEL: define i64 @f5_1() -// CHECK-LABEL: define void @f5_2(%struct.s5* byval align 4) +// CHECK-LABEL: define void @f5_2(double %a0.0) struct s5 { double a; }; @@ -39,7 +39,7 @@ struct s5 f5_1(void) { while (1) {} } void f5_2(struct s5 a0) {} // CHECK-LABEL: define i32 @f6_1() -// CHECK-LABEL: define void @f6_2(%struct.s6* byval align 4 %a0) +// CHECK-LABEL: define void @f6_2(float %a0.0) struct s6 { float a; }; |