11// RUN: %clang_cc1 -O0 -fenable-matrix -triple x86_64-apple-darwin %s -emit-llvm -disable-llvm-passes -o - -std=c++11 | FileCheck --check-prefixes=CHECK,NOOPT %s
22// RUN: %clang_cc1 -O1 -fenable-matrix -triple x86_64-apple-darwin %s -emit-llvm -disable-llvm-passes -o - -std=c++11 | FileCheck --check-prefixes=CHECK,OPT %s
3+ typedef double dx5x5_t __attribute__ ((matrix_type(5 , 5 )));
4+ using fx2x3_t = float __attribute__ ((matrix_type(2 , 3 )));
35
46template <typename EltTy, unsigned Rows, unsigned Columns>
57struct MyMatrix {
@@ -138,7 +140,7 @@ void test_IntWrapper_Add(MyMatrix<double, 10, 9> &m) {
138140 // NOOPT: [[MATRIX:%.*]] = load <90 x double>, ptr {{.*}}, align 8{{$}}
139141 // OPT: [[MATRIX:%.*]] = load <90 x double>, ptr {{.*}}, align 8, !tbaa !{{[0-9]+}}{{$}}
140142 // CHECK-NEXT: [[SCALAR:%.*]] = call noundef i32 @_ZN10IntWrappercviEv(ptr {{[^,]*}} %w3)
141- // CHECK-NEXT: [[SCALAR_FP:%.*]] = sitofp i32 [[SCALAR]] to double
143+ // CHECK-NEXT: [[SCALAR_FP:%.*]] = sitofp i32 %call to double
142144 // CHECK-NEXT: [[SCALAR_EMBED:%.*]] = insertelement <90 x double> poison, double [[SCALAR_FP]], i64 0
143145 // CHECK-NEXT: [[SCALAR_EMBED1:%.*]] = shufflevector <90 x double> [[SCALAR_EMBED]], <90 x double> poison, <90 x i32> zeroinitializer
144146 // CHECK-NEXT: [[RES:%.*]] = fadd <90 x double> [[MATRIX]], [[SCALAR_EMBED1]]
@@ -152,7 +154,7 @@ void test_IntWrapper_Add(MyMatrix<double, 10, 9> &m) {
152154void test_IntWrapper_Sub (MyMatrix<double , 10 , 9 > &m) {
153155 // CHECK-LABEL: define{{.*}} void @_Z19test_IntWrapper_SubR8MyMatrixIdLj10ELj9EE(
154156 // CHECK: [[SCALAR:%.*]] = call noundef i32 @_ZN10IntWrappercviEv(ptr {{[^,]*}} %w3)
155- // CHECK-NEXT: [[SCALAR_FP:%.*]] = sitofp i32 [[SCALAR]] to double
157+ // CHECK-NEXT: [[SCALAR_FP:%.*]] = sitofp i32 %call to double
156158 // NOOPT: [[MATRIX:%.*]] = load <90 x double>, ptr {{.*}}, align 8{{$}}
157159 // OPT: [[MATRIX:%.*]] = load <90 x double>, ptr {{.*}}, align 8, !tbaa !{{[0-9]+}}{{$}}
158160 // CHECK-NEXT: [[SCALAR_EMBED:%.*]] = insertelement <90 x double> poison, double [[SCALAR_FP]], i64 0
@@ -195,7 +197,7 @@ MyMatrix<float, 2, 2> test_multiply_template(MyMatrix<float, 2, 5> Mat1,
195197void test_IntWrapper_Multiply (MyMatrix<double , 10 , 9 > &m, IntWrapper &w3) {
196198 // CHECK-LABEL: define{{.*}} void @_Z24test_IntWrapper_MultiplyR8MyMatrixIdLj10ELj9EER10IntWrapper(
197199 // CHECK: [[SCALAR:%.*]] = call noundef i32 @_ZN10IntWrappercviEv(ptr noundef {{.*}})
198- // CHECK-NEXT: [[SCALAR_FP:%.*]] = sitofp i32 [[SCALAR]] to double
200+ // CHECK-NEXT: [[SCALAR_FP:%.*]] = sitofp i32 %call to double
199201 // NOOPT: [[MATRIX:%.*]] = load <90 x double>, ptr {{.*}}, align 8{{$}}
200202 // OPT: [[MATRIX:%.*]] = load <90 x double>, ptr {{.*}}, align 8, !tbaa !{{[0-9]+}}{{$}}
201203 // CHECK-NEXT: [[SCALAR_EMBED:%.*]] = insertelement <90 x double> poison, double [[SCALAR_FP]], i64 0
0 commit comments