[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-24 Thread Zarko Todorovski via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG64b8a633a872: [NFC] [PPC] Add PowerPC expected IR tests for 
C99 complex (authored by cebowleratibm, committed by ZarkoCA).

Changed prior to commit:
  https://reviews.llvm.org/D88105?vs=293917=294222#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

Files:
  clang/test/CodeGen/powerpc-c99complex.c


Index: clang/test/CodeGen/powerpc-c99complex.c
===
--- /dev/null
+++ clang/test/CodeGen/powerpc-c99complex.c
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple ppc64le-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefix=PPC32LNX
+
+_Complex float foo1(_Complex float x) {
+  return x;
+// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float 
%x.{{.*}}) #0 {
+// PPC64LNX: ret { float, float }
+
+// PPC32LNX-LABEL:   define void @foo1({ float, float }* noalias sret 
align 4 %agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
+// PPC32LNX: [[RETREAL:%.*]] = getelementptr inbounds { float, 
float }, { float, float }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:[[RETIMAG:%.*]] = getelementptr inbounds { float, 
float }, { float, float }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:store float %{{.*}}, float* [[RETREAL]], align 4
+// PPC32LNX-NEXT:store float %{{.*}}, float* [[RETIMAG]], align 4
+}
+
+_Complex double foo2(_Complex double x) {
+  return x;
+// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, 
double %x.{{.*}}) #0 {
+// PPC64LNX: ret { double, double }
+
+// PPC32LNX-LABEL:   define void @foo2({ double, double }* noalias sret 
align 8 %agg.result, { double, double }* byval({ double, double }) align 8 %x) 
#0 {
+// PPC32LNX: [[RETREAL:%.*]] = getelementptr inbounds { double, 
double }, { double, double }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:[[RETIMAG:%.*]] = getelementptr inbounds { double, 
double }, { double, double }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:store double %{{.*}}, double* [[RETREAL]], align 8
+// PPC32LNX-NEXT:store double %{{.*}}, double* [[RETIMAG]], align 8
+}
+
+_Complex long double foo3(_Complex long double x) {
+  return x;
+// PPC64LNX-LABEL:  define { ppc_fp128, ppc_fp128 } @foo3(ppc_fp128 
%x.{{.*}}, ppc_fp128 %x.{{.*}}) #0 {
+// PPC64LNX:ret { ppc_fp128, ppc_fp128 }
+
+// PPC32LNX-LABEL:  define void @foo3({ ppc_fp128, ppc_fp128 }* noalias 
sret align 16 %agg.result, { ppc_fp128, ppc_fp128 }* byval({ ppc_fp128, 
ppc_fp128 }) align 16 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store ppc_fp128 %{{.*}}, ppc_fp128* [[RETREAL]], align 
16
+// PPC32LNX-NEXT:   store ppc_fp128 %{{.*}}, ppc_fp128* [[RETIMAG]], align 
16
+}


Index: clang/test/CodeGen/powerpc-c99complex.c
===
--- /dev/null
+++ clang/test/CodeGen/powerpc-c99complex.c
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple ppc64le-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=PPC32LNX
+
+_Complex float foo1(_Complex float x) {
+  return x;
+// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float %x.{{.*}}) #0 {
+// PPC64LNX: ret { float, float }
+
+// PPC32LNX-LABEL:   define void @foo1({ float, float }* noalias sret align 4 %agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
+// PPC32LNX: [[RETREAL:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:[[RETIMAG:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:store float %{{.*}}, float* [[RETREAL]], align 4
+// PPC32LNX-NEXT:store float %{{.*}}, float* [[RETIMAG]], align 4
+}
+
+_Complex double foo2(_Complex double x) {
+  return x;
+// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, double %x.{{.*}}) #0 {
+// PPC64LNX: ret { double, double }
+
+// PPC32LNX-LABEL:   define void @foo2({ 

[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-24 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment.

Off-list discussion seems to indicate that only the NFC portion of the patch 
was intended to be approved.
That is, the scope of this patch is supposed to be 
https://reviews.llvm.org/D88105?id=293625 plus formatting changes.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-24 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment.

Looks to me that this (since it is approved) completely replaces D88130 
. The patch description needs to be changed of 
course.
Not sure if the committer wants to try splitting out the non-AIX test as an NFC 
patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-24 Thread Zarko Todorovski via Phabricator via cfe-commits
ZarkoCA added a comment.

In D88105#2292266 , @nemanjai wrote:

> This clearly changes behaviour and should thereby not have the `[NFC]` tag.

Looks like it accidentally includes https://reviews.llvm.org/D88130.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-24 Thread Nemanja Ivanovic via Phabricator via cfe-commits
nemanjai added a comment.

This clearly changes behaviour and should thereby not have the `[NFC]` tag.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-23 Thread Zarko Todorovski via Phabricator via cfe-commits
ZarkoCA accepted this revision.
ZarkoCA added a comment.

Thanks for doing the formatting changes.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-23 Thread Chris Bowler via Phabricator via cfe-commits
cebowleratibm updated this revision to Diff 293917.
cebowleratibm marked 2 inline comments as done.
cebowleratibm added a comment.

Reworked the prefixes and indentation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

Files:
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/aix-complex.c
  clang/test/CodeGen/powerpc-c99complex.c

Index: clang/test/CodeGen/powerpc-c99complex.c
===
--- clang/test/CodeGen/powerpc-c99complex.c
+++ clang/test/CodeGen/powerpc-c99complex.c
@@ -1,11 +1,13 @@
-// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
-// RUN: %clang_cc1 -triple ppc64le-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,AIX
+// RUN: %clang_cc1 -triple powerpc-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,AIX
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,PPC64LNX
+// RUN: %clang_cc1 -triple ppc64le-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,PPC64LNX
 // RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=PPC32LNX
 
 _Complex float foo1(_Complex float x) {
   return x;
-// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float %x.{{.*}}) #0 {
-// PPC64LNX: ret { float, float }
+// CHECK-LABEL: define { float, float } @foo1(float %x.{{.*}}, float %x.{{.*}}) #0 {
+// CHECK:   ret { float, float }
 
 // PPC32LNX-LABEL:  define void @foo1({ float, float }* noalias sret align 4 %agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
 // PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 0
@@ -16,8 +18,8 @@
 
 _Complex double foo2(_Complex double x) {
   return x;
-// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, double %x.{{.*}}) #0 {
-// PPC64LNX: ret { double, double }
+// CHECK-LABEL: define { double, double } @foo2(double %x.{{.*}}, double %x.{{.*}}) #0 {
+// CHECK:   ret { double, double }
 
 // PPC32LNX-LABEL:  define void @foo2({ double, double }* noalias sret align 8 %agg.result, { double, double }* byval({ double, double }) align 8 %x) #0 {
 // PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { double, double }, { double, double }* %agg.result, i32 0, i32 0
@@ -28,12 +30,15 @@
 
 _Complex long double foo3(_Complex long double x) {
   return x;
-// PPC64LNX-LDBL128-LABEL:define { ppc_fp128, ppc_fp128 } @foo3(ppc_fp128 %x.{{.*}}, ppc_fp128 %x.{{.*}}) #0 {
-// PPC64LNX-LDBL128:  ret { ppc_fp128, ppc_fp128 }
+// AIX-LABEL:   define { double, double } @foo3(double %x.{{.*}}, double %x.{{.*}}) #0 {
+// AIX: ret { double, double }
 
-// PPC32LNX-LABEL: define void @foo3({ ppc_fp128, ppc_fp128 }* noalias sret align 16 %agg.result, { ppc_fp128, ppc_fp128 }* byval({ ppc_fp128, ppc_fp128 }) align 16 %x) #0 {
-// PPC32LNX:   [[RETREAL:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 0
-// PPC32LNX-NEXT:  [[RETIMAG:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 1
-// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETREAL]], align 16
-// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETIMAG]], align 16
+// PPC64LNX-LABEL:  define { ppc_fp128, ppc_fp128 } @foo3(ppc_fp128 %x.{{.*}}, ppc_fp128 %x.{{.*}}) #0 {
+// PPC64LNX:ret { ppc_fp128, ppc_fp128 }
+
+// PPC32LNX-LABEL:  define void @foo3({ ppc_fp128, ppc_fp128 }* noalias sret align 16 %agg.result, { ppc_fp128, ppc_fp128 }* byval({ ppc_fp128, ppc_fp128 }) align 16 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store ppc_fp128 %{{.*}}, ppc_fp128* [[RETREAL]], align 16
+// PPC32LNX-NEXT:   store ppc_fp128 %{{.*}}, ppc_fp128* [[RETIMAG]], align 16
 }
Index: clang/test/CodeGen/aix-complex.c
===
--- clang/test/CodeGen/aix-complex.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// REQUIRES: powerpc-registered-target
-// RUN: not %clang_cc1 -triple powerpc-unknown-aix \
-// RUN:   -emit-llvm -o - %s 2>&1 | FileCheck %s
-// RUN: not %clang_cc1 -triple powerpc64-unknown-aix \
-// RUN:   -emit-llvm -o - %s 2>&1 | FileCheck %s
-
-// CHECK: fatal error: error in backend: complex type is not supported on AIX yet
-_Complex float foo_float(_Complex float x) {
-  

[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-23 Thread Zarko Todorovski via Phabricator via cfe-commits
ZarkoCA added inline comments.



Comment at: clang/test/CodeGen/powerpc-c99complex.c:7
+  return x;
+// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float 
%x.{{.*}}) #0 {
+// PPC64LNX: ret { float, float }

Nit: I don't think you need the `#0` here and anywhere below.



Comment at: clang/test/CodeGen/powerpc-c99complex.c:19-20
+  return x;
+// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, 
double %x.{{.*}}) #0 {
+// PPC64LNX: ret { double, double }
+

Nit: please line up these lines with the ones below. 



Comment at: clang/test/CodeGen/powerpc-c99complex.c:34-39
+// PPC32LNX-LABEL: define void @foo3({ ppc_fp128, ppc_fp128 }* noalias sret 
align 16 %agg.result, { ppc_fp128, ppc_fp128 }* byval({ ppc_fp128, ppc_fp128 }) 
align 16 %x) #0 {
+// PPC32LNX:   [[RETREAL:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:  [[RETIMAG:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETREAL]], align 16
+// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETIMAG]], align 16
+}

Nit: Can the formatting be fixed so the lines line up? 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-23 Thread David Tenty via Phabricator via cfe-commits
daltenty accepted this revision.
daltenty added a comment.
This revision is now accepted and ready to land.

LGTM, thanks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-22 Thread Chris Bowler via Phabricator via cfe-commits
cebowleratibm updated this revision to Diff 293625.
cebowleratibm marked an inline comment as done.
cebowleratibm added a comment.

Added ppc64le target.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

Files:
  clang/test/CodeGen/powerpc-c99complex.c


Index: clang/test/CodeGen/powerpc-c99complex.c
===
--- /dev/null
+++ clang/test/CodeGen/powerpc-c99complex.c
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple ppc64le-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefix=PPC32LNX
+
+_Complex float foo1(_Complex float x) {
+  return x;
+// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float 
%x.{{.*}}) #0 {
+// PPC64LNX: ret { float, float }
+
+// PPC32LNX-LABEL:  define void @foo1({ float, float }* noalias sret align 4 
%agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { float, float }, 
{ float, float }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { float, float }, 
{ float, float }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETREAL]], align 4
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETIMAG]], align 4
+}
+
+_Complex double foo2(_Complex double x) {
+  return x;
+// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, 
double %x.{{.*}}) #0 {
+// PPC64LNX: ret { double, double }
+
+// PPC32LNX-LABEL:  define void @foo2({ double, double }* noalias sret align 8 
%agg.result, { double, double }* byval({ double, double }) align 8 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { double, double 
}, { double, double }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { double, double 
}, { double, double }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store double %{{.*}}, double* [[RETREAL]], align 8
+// PPC32LNX-NEXT:   store double %{{.*}}, double* [[RETIMAG]], align 8
+}
+
+_Complex long double foo3(_Complex long double x) {
+  return x;
+// PPC64LNX-LDBL128-LABEL:define { ppc_fp128, ppc_fp128 } @foo3(ppc_fp128 
%x.{{.*}}, ppc_fp128 %x.{{.*}}) #0 {
+// PPC64LNX-LDBL128:  ret { ppc_fp128, ppc_fp128 }
+
+// PPC32LNX-LABEL: define void @foo3({ ppc_fp128, ppc_fp128 }* noalias sret 
align 16 %agg.result, { ppc_fp128, ppc_fp128 }* byval({ ppc_fp128, ppc_fp128 }) 
align 16 %x) #0 {
+// PPC32LNX:   [[RETREAL:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:  [[RETIMAG:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETREAL]], align 16
+// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETIMAG]], align 16
+}


Index: clang/test/CodeGen/powerpc-c99complex.c
===
--- /dev/null
+++ clang/test/CodeGen/powerpc-c99complex.c
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple ppc64le-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=PPC32LNX
+
+_Complex float foo1(_Complex float x) {
+  return x;
+// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float %x.{{.*}}) #0 {
+// PPC64LNX: ret { float, float }
+
+// PPC32LNX-LABEL:  define void @foo1({ float, float }* noalias sret align 4 %agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETREAL]], align 4
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETIMAG]], align 4
+}
+
+_Complex double foo2(_Complex double x) {
+  return x;
+// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, double %x.{{.*}}) #0 {
+// PPC64LNX: ret { double, double }
+
+// PPC32LNX-LABEL:  define void @foo2({ double, double }* noalias sret align 8 %agg.result, { double, double }* byval({ double, double }) align 8 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { double, double }, { double, double }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   

[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-22 Thread Zarko Todorovski via Phabricator via cfe-commits
ZarkoCA added inline comments.



Comment at: clang/test/CodeGen/powerpc-c99complex.c:1
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefix=PPC32LNX

Can you add ppc64le as well? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88105/new/

https://reviews.llvm.org/D88105

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D88105: [NFC] [PPC] Add PowerPC expected IR tests for C99 complex

2020-09-22 Thread Chris Bowler via Phabricator via cfe-commits
cebowleratibm created this revision.
cebowleratibm added reviewers: daltenty, ZarkoCA, sfertile.
Herald added subscribers: cfe-commits, shchenz, nemanjai.
Herald added a project: clang.
cebowleratibm requested review of this revision.

Adding this test so that I can extend it in a follow on patch with expected IR 
for AIX when I implement complex handling in AIXABIInfo.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88105

Files:
  clang/test/CodeGen/powerpc-c99complex.c


Index: clang/test/CodeGen/powerpc-c99complex.c
===
--- /dev/null
+++ clang/test/CodeGen/powerpc-c99complex.c
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | 
FileCheck %s --check-prefix=PPC32LNX
+
+_Complex float foo1(_Complex float x) {
+  return x;
+// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float 
%x.{{.*}}) #0 {
+// PPC64LNX: ret { float, float }
+
+// PPC32LNX-LABEL:  define void @foo1({ float, float }* noalias sret align 4 
%agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { float, float }, 
{ float, float }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { float, float }, 
{ float, float }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETREAL]], align 4
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETIMAG]], align 4
+}
+
+_Complex double foo2(_Complex double x) {
+  return x;
+// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, 
double %x.{{.*}}) #0 {
+// PPC64LNX: ret { double, double }
+
+// PPC32LNX-LABEL:  define void @foo2({ double, double }* noalias sret align 8 
%agg.result, { double, double }* byval({ double, double }) align 8 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { double, double 
}, { double, double }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { double, double 
}, { double, double }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store double %{{.*}}, double* [[RETREAL]], align 8
+// PPC32LNX-NEXT:   store double %{{.*}}, double* [[RETIMAG]], align 8
+}
+
+_Complex long double foo3(_Complex long double x) {
+  return x;
+// PPC64LNX-LDBL128-LABEL:define { ppc_fp128, ppc_fp128 } @foo3(ppc_fp128 
%x.{{.*}}, ppc_fp128 %x.{{.*}}) #0 {
+// PPC64LNX-LDBL128:  ret { ppc_fp128, ppc_fp128 }
+
+// PPC32LNX-LABEL: define void @foo3({ ppc_fp128, ppc_fp128 }* noalias sret 
align 16 %agg.result, { ppc_fp128, ppc_fp128 }* byval({ ppc_fp128, ppc_fp128 }) 
align 16 %x) #0 {
+// PPC32LNX:   [[RETREAL:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:  [[RETIMAG:%.*]] = getelementptr inbounds { ppc_fp128, 
ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETREAL]], align 16
+// PPC32LNX-NEXT:  store ppc_fp128 %{{.*}}, ppc_fp128* [[RETIMAG]], align 16
+}


Index: clang/test/CodeGen/powerpc-c99complex.c
===
--- /dev/null
+++ clang/test/CodeGen/powerpc-c99complex.c
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=PPC32LNX
+
+_Complex float foo1(_Complex float x) {
+  return x;
+// PPC64LNX-LABEL:   define { float, float } @foo1(float %x.{{.*}}, float %x.{{.*}}) #0 {
+// PPC64LNX: ret { float, float }
+
+// PPC32LNX-LABEL:  define void @foo1({ float, float }* noalias sret align 4 %agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 1
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETREAL]], align 4
+// PPC32LNX-NEXT:   store float %{{.*}}, float* [[RETIMAG]], align 4
+}
+
+_Complex double foo2(_Complex double x) {
+  return x;
+// PPC64LNX-LABEL:   define { double, double } @foo2(double %x.{{.*}}, double %x.{{.*}}) #0 {
+// PPC64LNX: ret { double, double }
+
+// PPC32LNX-LABEL:  define void @foo2({ double, double }* noalias sret align 8 %agg.result, { double, double }* byval({ double, double }) align 8 %x) #0 {
+// PPC32LNX:[[RETREAL:%.*]] = getelementptr inbounds { double, double }, { double, double }* %agg.result, i32 0, i32 0
+// PPC32LNX-NEXT:   [[RETIMAG:%.*]] = getelementptr inbounds {