[PATCH] D100834: Bug 49739 - [Matrix] Support #pragma clang fp

Hamza Mahfooz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 20 04:04:02 PDT 2021


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>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100834.338812.patch
Type: text/x-patch
Size: 1021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210420/47da72fb/attachment.bin>


More information about the cfe-commits mailing list