From 47d2f54f3ca1187809f9aa82f7b79753a6b298ee Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Mon, 18 Sep 2023 21:47:41 -0400 Subject: [PATCH] [BLAS] fix row transpose arg --- .../test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy.ll | 6 +++--- .../ReverseMode/blas/gemv_f_c_split_blascpy_runtime_act.ll | 4 ++-- .../test/Enzyme/ReverseMode/blas/gemv_f_c_split_memcpy.ll | 2 +- enzyme/tools/enzyme-tblgen/blas-tblgen.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy.ll b/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy.ll index f2bef95aec83..a05cdb333fd1 100644 --- a/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy.ll +++ b/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy.ll @@ -187,7 +187,7 @@ entry: ; CHECK-NEXT: store i64 1, i64* %byref.constant.int.1 ; CHECK-NEXT: %intcast.constant.int.1 = bitcast i64* %byref.constant.int.1 to i8* ; CHECK-NEXT: call void @dgemv_64_(i8* %malloccall, i8* %m_p, i8* %n_p, i8* %fpcast.constant.fp.1.0, i8* %A, i8* %lda_p, i8* %20, i8* %intcast.int.one, i8* %fpcast.constant.fp.0.0, i8* %19, i8* %intcast.constant.int.1) -; CHECK-NEXT: %ld.row.trans = load i8, i8* %byref.transpose.transa +; CHECK-NEXT: %ld.row.trans = load i8, i8* %malloccall ; CHECK-DAG: %[[c1:.+]] = icmp eq i8 %ld.row.trans, 110 ; CHECK-DAG: %[[c2:.+]] = icmp eq i8 %ld.row.trans, 78 ; CHECK-NEXT: %[[c3:.+]] = or i1 %[[c2]], %[[c1]] @@ -203,7 +203,7 @@ entry: ; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.09 ; CHECK-NEXT: %fpcast.constant.fp.1.010 = bitcast double* %byref.constant.fp.1.09 to i8* ; CHECK-NEXT: call void @dgemv_64_(i8* %byref.transpose.transa, i8* %m_p, i8* %n_p, i8* %alpha, i8* %A, i8* %lda_p, i8* %"y'", i8* %incy_p, i8* %fpcast.constant.fp.1.010, i8* %"x'", i8* %incx_p) -; CHECK-NEXT: %ld.row.trans11 = load i8, i8* %byref.transpose.transa +; CHECK-NEXT: %ld.row.trans11 = load i8, i8* %malloccall ; CHECK-DAG: %[[r39:.+]] = icmp eq i8 %ld.row.trans11, 110 ; CHECK-DAG: %[[r40:.+]] = icmp eq i8 %ld.row.trans11, 78 ; CHECK-NEXT: %41 = or i1 %[[r40]], %[[r39]] @@ -213,7 +213,7 @@ entry: ; CHECK-NEXT: %45 = load double, double* %44 ; CHECK-NEXT: %46 = fadd fast double %45, %43 ; CHECK-NEXT: store double %46, double* %44 -; CHECK-NEXT: %ld.row.trans12 = load i8, i8* %byref.transpose.transa +; CHECK-NEXT: %ld.row.trans12 = load i8, i8* %malloccall ; CHECK-DAG: %[[r47:.+]] = icmp eq i8 %ld.row.trans12, 110 ; CHECK-DAG: %[[r48:.+]] = icmp eq i8 %ld.row.trans12, 78 ; CHECK-NEXT: %49 = or i1 %[[r48]], %[[r47]] diff --git a/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy_runtime_act.ll b/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy_runtime_act.ll index a214afa93a24..81655aebbe38 100644 --- a/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy_runtime_act.ll +++ b/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_blascpy_runtime_act.ll @@ -178,7 +178,7 @@ entry: ; CHECK-NEXT: br i1 %rt.inactive.beta, label %invertentry.beta.done, label %invertentry.beta.active ; CHECK: invertentry.beta.active: ; preds = %invertentry.A.done -; CHECK-NEXT: %ld.row.trans = load i8, i8* %byref.transpose.transa +; CHECK-NEXT: %ld.row.trans = load i8, i8* %malloccall ; CHECK-DAG: %[[r39:.+]] = icmp eq i8 %ld.row.trans, 110 ; CHECK-DAG: %[[r40:.+]] = icmp eq i8 %ld.row.trans, 78 ; CHECK-NEXT: %[[r41:.+]] = or i1 %[[r40]], %[[r39]] @@ -194,7 +194,7 @@ entry: ; CHECK-NEXT: br i1 %rt.inactive.y, label %invertentry.y.done, label %invertentry.y.active ; CHECK: invertentry.y.active: ; preds = %invertentry.beta.done -; CHECK-NEXT: %ld.row.trans2 = load i8, i8* %byref.transpose.transa +; CHECK-NEXT: %ld.row.trans2 = load i8, i8* %malloccall ; CHECK-DAG: %[[r47:.+]] = icmp eq i8 %ld.row.trans2, 110 ; CHECK-DAG: %[[r48:.+]] = icmp eq i8 %ld.row.trans2, 78 ; CHECK-NEXT: %[[r49:.+]] = or i1 %[[r48]], %[[r47]] diff --git a/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_memcpy.ll b/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_memcpy.ll index 8a1dd30e639e..65857bbba6ec 100644 --- a/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_memcpy.ll +++ b/enzyme/test/Enzyme/ReverseMode/blas/gemv_f_c_split_memcpy.ll @@ -194,7 +194,7 @@ entry: ; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.0 ; CHECK-NEXT: %fpcast.constant.fp.1.0 = bitcast double* %byref.constant.fp.1.0 to i8* ; CHECK-NEXT: call void @dgemv_64_(i8* %byref.transpose.transa, i8* %m_p, i8* %n_p, i8* %alpha_p, i8* %A, i8* %lda_p, i8* %"y'", i8* %incy_p, i8* %fpcast.constant.fp.1.0, i8* %"x'", i8* %incx_p) -; CHECK-NEXT: %ld.row.trans = load i8, i8* %byref.transpose.transa +; CHECK-NEXT: %ld.row.trans = load i8, i8* %malloccall ; CHECK-DAG: %[[r2:.+]] = icmp eq i8 %ld.row.trans, 110 ; CHECK-DAG: %[[r3:.+]] = icmp eq i8 %ld.row.trans, 78 ; CHECK-NEXT: %26 = or i1 %[[r3]], %[[r2]] diff --git a/enzyme/tools/enzyme-tblgen/blas-tblgen.cpp b/enzyme/tools/enzyme-tblgen/blas-tblgen.cpp index 92e8c30e3020..f178d795bab1 100644 --- a/enzyme/tools/enzyme-tblgen/blas-tblgen.cpp +++ b/enzyme/tools/enzyme-tblgen/blas-tblgen.cpp @@ -1042,7 +1042,7 @@ void rev_call_arg(StringRef argName, DagInit *ruleDag, Rule &rule, auto tname = Dag->getArgNameStr(0); auto rname = Dag->getArgNameStr(1); auto cname = Dag->getArgNameStr(2); - os << "get_blas_row(Builder2, arg_transposed_" << tname << ", arg_" + os << "get_blas_row(Builder2, arg_" << tname << ", arg_" << rname << ", arg_" << cname << ", byRef)"; } else if (Def->isSubClassOf("MagicInst") && Def->getName() == "ld") { assert(Dag->getNumArgs() == 5);