Skip to content

Commit

Permalink
but it's honest work
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuseZ4 committed Oct 25, 2023
1 parent bf431e7 commit 872e7b5
Showing 1 changed file with 21 additions and 30 deletions.
51 changes: 21 additions & 30 deletions enzyme/test/Enzyme/ReverseMode/blas/gemm_f.ll
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,12 @@ entry:
; CHECK-DAG: %byref.transpose.transa = alloca i8
; CHECK-DAG: %byref.transpose.transb = alloca i8
; CHECK-DAG: %byref.int.one = alloca i64
; CHECK-DAG: %byref.constant.char.T = alloca i8, align 1
; CHECK-DAG: %byref.constant.char.N = alloca i8, align 1
; CHECK-DAG: %byref.constant.fp.1.0 = alloca double
; CHECK-DAG: %byref.constant.char.T2 = alloca i8, align 1
; CHECK-DAG: %byref.constant.char.N3 = alloca i8, align 1
; CHECK-DAG: %byref.constant.fp.1.06 = alloca double
; CHECK-DAG: %[[byref_fp_1:.+]] = alloca double
; CHECK-DAG: %[[byref_fp_1_0:.+]] = alloca double
; CHECK-DAG: %byref.constant.char.G = alloca i8
; CHECK-DAG: %byref.constant.int.0 = alloca i64
; CHECK-DAG: %[[byrefconstantint1:.+]] = alloca i64
; CHECK-DAG: %byref.constant.fp.1.010 = alloca double
; CHECK-DAG: %[[byref_fp_1_00:.+]] = alloca double
; CHECK-DAG: %[[tmp:.+]] = alloca i8
; CHECK-DAG: %transa = alloca i8, align 1
; CHECK-DAG: %transb = alloca i8, align 1
Expand Down Expand Up @@ -116,15 +112,12 @@ entry:
; CHECK-NEXT: store i8 %[[i25]], i8* %byref.transpose.transb
; CHECK-NEXT: store i64 1, i64* %byref.int.one
; CHECK-NEXT: %intcast.int.one = bitcast i64* %byref.int.one to i8*

; CHECK-NEXT: store i8 84, i8* %byref.constant.char.T, align 1
; CHECK-NEXT: store i8 78, i8* %byref.constant.char.N, align 1
; CHECK-NEXT: %ld.row.trans = load i8, i8* %transa, align 1
; CHECK-NEXT: %[[a16:.+]] = icmp eq i8 %ld.row.trans, 110
; CHECK-NEXT: %[[a17:.+]] = icmp eq i8 %ld.row.trans, 78
; CHECK-NEXT: %[[a18:.+]] = or i1 %[[a17]], %[[a16]]
; CHECK-NEXT: %[[a19:.+]] = select i1 %[[a18]], i8* %byref.constant.char.N, i8* %transb
; CHECK-NEXT: %[[a20:.+]] = select i1 %[[a18]], i8* %byref.transpose.transb, i8* %byref.constant.char.T
; CHECK-NEXT: %[[a19:.+]] = select i1 %[[a18]], i8* %transa, i8* %transb
; CHECK-NEXT: %[[a20:.+]] = select i1 %[[a18]], i8* %byref.transpose.transb, i8* %transa
; CHECK-NEXT: %[[a21:.+]] = select i1 %[[a18]], i8* %m_p, i8* %k_p
; CHECK-NEXT: %[[a22:.+]] = select i1 %[[a18]], i8* %k_p, i8* %m_p
; CHECK-NEXT: %ld.row.trans1 = load i8, i8* %transa, align 1
Expand All @@ -135,37 +128,35 @@ entry:
; CHECK-NEXT: %[[a27:.+]] = select i1 %[[a25]], i8* %ldc_p, i8* %ldb_p
; CHECK-NEXT: %[[a28:.+]] = select i1 %[[a25]], i8* %B, i8* %"C'"
; CHECK-NEXT: %[[a29:.+]] = select i1 %[[a25]], i8* %ldb_p, i8* %ldc_p
; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.0, align 8
; CHECK-NEXT: %fpcast.constant.fp.1.0 = bitcast double* %byref.constant.fp.1.0 to i8*
; CHECK-NEXT: call void @dgemm_64_(i8* %[[a19]], i8* %[[a20]], i8* %[[a21]], i8* %[[a22]], i8* %n_p, i8* %alpha_p, i8* %[[a26]], i8* %[[a27]], i8* %[[a28]], i8* %[[a29]], i8* %fpcast.constant.fp.1.0, i8* %"A'", i8* %lda_p, i64 1, i64 1)
; CHECK-NEXT: store i8 84, i8* %byref.constant.char.T2, align 1
; CHECK-NEXT: store i8 78, i8* %byref.constant.char.N3, align 1
; CHECK-NEXT: %ld.row.trans4 = load i8, i8* %transb, align 1
; CHECK-NEXT: %[[a30:.+]] = icmp eq i8 %ld.row.trans4, 110
; CHECK-NEXT: %[[a31:.+]] = icmp eq i8 %ld.row.trans4, 78
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_1]], align 8
; CHECK-NEXT: %[[fpcast_1:.+]] = bitcast double* %[[byref_fp_1]] to i8*
; CHECK-NEXT: call void @dgemm_64_(i8* %[[a19]], i8* %[[a20]], i8* %[[a21]], i8* %[[a22]], i8* %n_p, i8* %alpha_p, i8* %[[a26]], i8* %[[a27]], i8* %[[a28]], i8* %[[a29]], i8* %[[fpcast_1]], i8* %"A'", i8* %lda_p, i64 1, i64 1)
; CHECK-NEXT: %[[ld_row_trans2:.+]] = load i8, i8* %transb, align 1
; CHECK-NEXT: %[[a30:.+]] = icmp eq i8 %[[ld_row_trans2]], 110
; CHECK-NEXT: %[[a31:.+]] = icmp eq i8 %[[ld_row_trans2]], 78
; CHECK-NEXT: %[[a32:.+]] = or i1 %[[a31]], %[[a30]]
; CHECK-NEXT: %[[a33:.+]] = select i1 %[[a32]], i8* %byref.transpose.transa, i8* %byref.constant.char.T2
; CHECK-NEXT: %[[a34:.+]] = select i1 %[[a32]], i8* %byref.constant.char.N3, i8* %transa
; CHECK-NEXT: %[[a33:.+]] = select i1 %[[a32]], i8* %byref.transpose.transa, i8* %transb
; CHECK-NEXT: %[[a34:.+]] = select i1 %[[a32]], i8* %transb, i8* %transa
; CHECK-NEXT: %[[a35:.+]] = select i1 %[[a32]], i8* %k_p, i8* %n_p
; CHECK-NEXT: %[[a36:.+]] = select i1 %[[a32]], i8* %n_p, i8* %k_p
; CHECK-NEXT: %ld.row.trans5 = load i8, i8* %transb, align 1
; CHECK-NEXT: %[[a37:.+]] = icmp eq i8 %ld.row.trans5, 110
; CHECK-NEXT: %[[a38:.+]] = icmp eq i8 %ld.row.trans5, 78
; CHECK-NEXT: %[[ld_row_trans3:.+]] = load i8, i8* %transb, align 1
; CHECK-NEXT: %[[a37:.+]] = icmp eq i8 %[[ld_row_trans3]], 110
; CHECK-NEXT: %[[a38:.+]] = icmp eq i8 %[[ld_row_trans3]], 78
; CHECK-NEXT: %[[a39:.+]] = or i1 %[[a38]], %[[a37]]
; CHECK-NEXT: %[[a40:.+]] = select i1 %[[a39]], i8* %A, i8* %"C'"
; CHECK-NEXT: %[[a41:.+]] = select i1 %[[a39]], i8* %lda_p, i8* %ldc_p
; CHECK-NEXT: %[[a42:.+]] = select i1 %[[a39]], i8* %"C'", i8* %A
; CHECK-NEXT: %[[a43:.+]] = select i1 %[[a39]], i8* %ldc_p, i8* %lda_p
; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.06, align 8
; CHECK-NEXT: %fpcast.constant.fp.1.07 = bitcast double* %byref.constant.fp.1.06 to i8*
; CHECK-NEXT: call void @dgemm_64_(i8* %[[a33]], i8* %[[a34]], i8* %[[a35]], i8* %[[a36]], i8* %m_p, i8* %alpha_p, i8* %[[a40]], i8* %[[a41]], i8* %[[a42]], i8* %[[a43]], i8* %fpcast.constant.fp.1.07, i8* %"B'", i8* %ldb_p, i64 1, i64 1)
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_1_0]], align 8
; CHECK-NEXT: %[[fpcast_1_0:.+]] = bitcast double* %[[byref_fp_1_0]] to i8*
; CHECK-NEXT: call void @dgemm_64_(i8* %[[a33]], i8* %[[a34]], i8* %[[a35]], i8* %[[a36]], i8* %m_p, i8* %alpha_p, i8* %[[a40]], i8* %[[a41]], i8* %[[a42]], i8* %[[a43]], i8* %[[fpcast_1_0]], i8* %"B'", i8* %ldb_p, i64 1, i64 1)
; CHECK-NEXT: store i8 71, i8* %byref.constant.char.G
; CHECK-NEXT: store i64 0, i64* %byref.constant.int.0
; CHECK-NEXT: %intcast.constant.int.0 = bitcast i64* %byref.constant.int.0 to i8*
; CHECK-NEXT: store i64 0, i64* %[[byrefconstantint1]]
; CHECK-NEXT: %[[int02:.+]] = bitcast i64* %[[byrefconstantint1]] to i8*
; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.0
; CHECK-NEXT: %[[fp11:.+]] = bitcast double* %byref.constant.fp.1.010 to i8*
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_1_00]]
; CHECK-NEXT: %[[fp11:.+]] = bitcast double* %[[byref_fp_1_00]] to i8*
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[int02]], i8* %[[fp11]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
; CHECK-NEXT: ret void
; CHECK-NEXT: }

0 comments on commit 872e7b5

Please sign in to comment.