effective-light updated this revision to Diff 338812.
effective-light added a comment.
Remove the unnecessary flags and add another test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100834/new/
https://reviews.llvm.org/D100834
Files:
clang/test/CodeGen/fp-matrix-pragma.c
Index: clang/test/CodeGen/fp-matrix-pragma.c
===================================================================
--- clang/test/CodeGen/fp-matrix-pragma.c
+++ clang/test/CodeGen/fp-matrix-pragma.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -S -fenable-matrix
--target=arm64-unknown-iphoneos -g0 -mllvm -disable-llvm-optzns -o - |
FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -S -fenable-matrix -mllvm -disable-llvm-optzns
-o - | FileCheck %s
typedef float fx2x2_t __attribute__((matrix_type(2, 2)));
typedef int ix2x2_t __attribute__((matrix_type(2, 2)));
@@ -18,6 +18,13 @@
return a + b - c;
}
+fx2x2_t fp_matrix_ops(fx2x2_t a, fx2x2_t b, fx2x2_t c) {
+// CHECK: call reassoc contract <4 x float>
@llvm.matrix.multiply.v4f32.v4f32.v4f32
+// CHECK: fadd reassoc contract <4 x float>
+#pragma clang fp contract(fast) reassociate(on)
+ return a * b + c;
+}
+
ix2x2_t int_matrix_ops(ix2x2_t a, ix2x2_t b, ix2x2_t c) {
// CHECK: call <4 x i32> @llvm.matrix.multiply.v4i32.v4i32.v4i32
// CHECK: add <4 x i32>
Index: clang/test/CodeGen/fp-matrix-pragma.c
===================================================================
--- clang/test/CodeGen/fp-matrix-pragma.c
+++ clang/test/CodeGen/fp-matrix-pragma.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -S -fenable-matrix --target=arm64-unknown-iphoneos -g0 -mllvm -disable-llvm-optzns -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -S -fenable-matrix -mllvm -disable-llvm-optzns -o - | FileCheck %s
typedef float fx2x2_t __attribute__((matrix_type(2, 2)));
typedef int ix2x2_t __attribute__((matrix_type(2, 2)));
@@ -18,6 +18,13 @@
return a + b - c;
}
+fx2x2_t fp_matrix_ops(fx2x2_t a, fx2x2_t b, fx2x2_t c) {
+// CHECK: call reassoc contract <4 x float> @llvm.matrix.multiply.v4f32.v4f32.v4f32
+// CHECK: fadd reassoc contract <4 x float>
+#pragma clang fp contract(fast) reassociate(on)
+ return a * b + c;
+}
+
ix2x2_t int_matrix_ops(ix2x2_t a, ix2x2_t b, ix2x2_t c) {
// CHECK: call <4 x i32> @llvm.matrix.multiply.v4i32.v4i32.v4i32
// CHECK: add <4 x i32>
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits