[clang] 7c50c1e - [clang][x86] Pull out PR51324 / PR60006 test cases into their own codegen test files
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 3 05:08:54 PDT 2024
Author: Simon Pilgrim
Date: 2024-10-03T13:08:34+01:00
New Revision: 7c50c1e73bc959246933d294319391e762bb05d5
URL: https://github.com/llvm/llvm-project/commit/7c50c1e73bc959246933d294319391e762bb05d5
DIFF: https://github.com/llvm/llvm-project/commit/7c50c1e73bc959246933d294319391e762bb05d5.diff
LOG: [clang][x86] Pull out PR51324 / PR60006 test cases into their own codegen test files
Added:
clang/test/CodeGen/X86/pr51324.c
clang/test/CodeGen/X86/pr60006.c
Modified:
clang/test/CodeGen/X86/sse41-builtins.c
Removed:
################################################################################
diff --git a/clang/test/CodeGen/X86/pr51324.c b/clang/test/CodeGen/X86/pr51324.c
new file mode 100644
index 00000000000000..10d1ba3c84b850
--- /dev/null
+++ b/clang/test/CodeGen/X86/pr51324.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
+
+
+#include <immintrin.h>
+
+// Make sure brackets work after macro intrinsics.
+float pr51324(__m128 a) {
+ // CHECK-LABEL: pr51324
+ // CHECK: call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %{{.*}}, i32 0)
+ // CHECK: extractelement <4 x float> %{{.*}}, i32 0
+ return _mm_round_ps(a, 0)[0];
+}
diff --git a/clang/test/CodeGen/X86/pr60006.c b/clang/test/CodeGen/X86/pr60006.c
new file mode 100644
index 00000000000000..4ef8504a52f07f
--- /dev/null
+++ b/clang/test/CodeGen/X86/pr60006.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
+
+
+#include <immintrin.h>
+
+// Ensure _mm_test_all_ones macro doesn't reuse argument
+__m128i expensive_call();
+int pr60006() {
+ // CHECK-LABEL: pr60006
+ // CHECK: call {{.*}} @expensive_call
+ // CHECK-NOT: call {{.*}} @expensive_call
+ // CHECK: call i32 @llvm.x86.sse41.ptestc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
+ return _mm_test_all_ones(expensive_call());
+}
diff --git a/clang/test/CodeGen/X86/sse41-builtins.c b/clang/test/CodeGen/X86/sse41-builtins.c
index bfe7a917a88555..905122edc51f7d 100644
--- a/clang/test/CodeGen/X86/sse41-builtins.c
+++ b/clang/test/CodeGen/X86/sse41-builtins.c
@@ -400,20 +400,3 @@ int test_mm_testz_si128(__m128i x, __m128i y) {
return _mm_testz_si128(x, y);
}
-// Make sure brackets work after macro intrinsics.
-float pr51324(__m128 a) {
- // CHECK-LABEL: pr51324
- // CHECK: call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %{{.*}}, i32 0)
- // CHECK: extractelement <4 x float> %{{.*}}, i32 0
- return _mm_round_ps(a, 0)[0];
-}
-
-// Ensure _mm_test_all_ones macro doesn't reuse argument
-__m128i expensive_call();
-int pr60006() {
- // CHECK-LABEL: pr60006
- // CHECK: call {{.*}} @expensive_call
- // CHECK-NOT: call {{.*}} @expensive_call
- // CHECK: call i32 @llvm.x86.sse41.ptestc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
- return _mm_test_all_ones(expensive_call());
-}
More information about the cfe-commits
mailing list