Skip to content

Commit c808878

Browse files
authored
Fix dlascl api (#1522)
1 parent 01c279c commit c808878

File tree

12 files changed

+24
-25
lines changed

12 files changed

+24
-25
lines changed

enzyme/test/Enzyme/ReverseMode/blas/gemm_f.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ entry:
5757
; CHECK-DAG: %byref.constant.int.0 = alloca i64
5858
; CHECK-DAG: %[[byrefconstantint1:.+]] = alloca i64
5959
; CHECK-DAG: %[[byref_fp_1_00:.+]] = alloca double
60-
; CHECK-DAG: %[[tmp:.+]] = alloca i8
60+
; CHECK-DAG: %[[tmp:.+]] = alloca i64
6161
; CHECK-DAG: %transa = alloca i8, align 1
6262
; CHECK-DAG: %transb = alloca i8, align 1
6363
; CHECK-DAG: %m = alloca i64, align 16
@@ -157,6 +157,6 @@ entry:
157157
; CHECK-NEXT: %[[int02:.+]] = bitcast i64* %[[byrefconstantint1]] to i8*
158158
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_1_00]]
159159
; CHECK-NEXT: %[[fp11:.+]] = bitcast double* %[[byref_fp_1_00]] to i8*
160-
; 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)
160+
; 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, i64* %[[tmp]], i64 1)
161161
; CHECK-NEXT: ret void
162162
; CHECK-NEXT: }

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_c.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ entry:
5959
; CHECK-NEXT: %byref.constant.int.0 = alloca i64, align 8
6060
; CHECK-NEXT: %[[byrefconstantint4:.+]] = alloca i64, align 8
6161
; CHECK-NEXT: %[[byref_fp_1_017:.+]] = alloca double, align 8
62-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
62+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
6363
; CHECK-NEXT: %transa = alloca i8, align 1
6464
; CHECK-NEXT: %transb = alloca i8, align 1
6565
; CHECK-NEXT: %m = alloca i64, align 16
@@ -275,7 +275,7 @@ entry:
275275
; CHECK-NEXT: %[[intcast07:.+]] = bitcast i64* %[[byrefconstantint4]] to i8*
276276
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_1_017]]
277277
; CHECK-NEXT: %[[fpcast_1_018:.+]] = bitcast double* %[[byref_fp_1_017]] to i8*
278-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast07]], i8* %[[fpcast_1_018]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
278+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast07]], i8* %[[fpcast_1_018]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
279279
; CHECK-NEXT: %[[ret1:.+]] = bitcast double* %cache.A to i8*
280280
; CHECK-NEXT: tail call void @free(i8* nonnull %[[ret1]])
281281
; CHECK-NEXT: %[[ret2:.+]] = bitcast double* %cache.B to i8*

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_c_lacpy_runtime_act.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ entry:
6161
; CHECK-NEXT: %byref.constant.int.0 = alloca i64, align 8
6262
; CHECK-NEXT: %[[byref_int_019:.+]] = alloca i64, align 8
6363
; CHECK-NEXT: %[[byref_fp_021:.+]] = alloca double, align 8
64-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
64+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
6565
; CHECK-NEXT: %transa = alloca i8, align 1
6666
; CHECK-NEXT: %transb = alloca i8, align 1
6767
; CHECK-NEXT: %m = alloca i64, align 16
@@ -348,7 +348,7 @@ entry:
348348
; CHECK-NEXT: %[[intcast_020:.+]] = bitcast i64* %[[byref_int_019]] to i8*
349349
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_021]]
350350
; CHECK-NEXT: %[[fpcast_1_022:.+]] = bitcast double* %[[byref_fp_021]] to i8*
351-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast_020]], i8* %[[fpcast_1_022]], i8* %beta, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
351+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast_020]], i8* %[[fpcast_1_022]], i8* %beta, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
352352
; CHECK-NEXT: br label %invertentry.C.done
353353

354354
; CHECK: invertentry.C.done: ; preds = %invertentry.C.active, %invertentry.beta.done

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_c_loop.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ entry:
8181
; CHECK-NEXT: %byref.constant.int.0 = alloca i64, align 8
8282
; CHECK-NEXT: %byref.constant.int.033 = alloca i64, align 8
8383
; CHECK-NEXT: %byref.constant.fp.1.035 = alloca double, align 8
84-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
84+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
8585
; CHECK-NEXT: %transa = alloca i8, align 1
8686
; CHECK-NEXT: %transb = alloca i8, align 1
8787
; CHECK-NEXT: %n = alloca i64, align 16
@@ -295,7 +295,7 @@ entry:
295295
; CHECK-NEXT: %intcast.constant.int.034 = bitcast i64* %byref.constant.int.033 to i8*
296296
; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.035, align 8
297297
; CHECK-NEXT: %fpcast.constant.fp.1.036 = bitcast double* %byref.constant.fp.1.035 to i8*
298-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %intcast.constant.int.034, i8* %fpcast.constant.fp.1.036, i8* %cast.beta, i8* %[[r37]], i8* %n_p_unwrap, i8* %"C'", i8* %cast.ldc, i8* %[[tmp]], i64 1)
298+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %intcast.constant.int.034, i8* %fpcast.constant.fp.1.036, i8* %cast.beta, i8* %[[r37]], i8* %n_p_unwrap, i8* %"C'", i8* %cast.ldc, i64* %[[tmp]], i64 1)
299299
; CHECK-NEXT: %[[r77:.+]] = bitcast double* %cache.A_unwrap to i8*
300300
; CHECK-NEXT: tail call void @free(i8* nonnull %[[r77]])
301301
; CHECK-NEXT: call void @free(i8* %[[r37]])

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_c_split.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ entry:
163163
; CHECK-NEXT: %byref.constant.int.0 = alloca i64
164164
; CHECK-NEXT: %[[byref_int_0:.+]] = alloca i64
165165
; CHECK-NEXT: %[[byref_fp_1_011:.+]] = alloca double
166-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
166+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
167167
; CHECK-NEXT: %ldc = alloca i64, i64 1, align 16
168168
; CHECK-NEXT: %[[i1:.+]] = bitcast i64* %ldc to i8*
169169
; CHECK-NEXT: %beta = alloca double, i64 1, align 16
@@ -289,7 +289,7 @@ entry:
289289
; CHECK-NEXT: %[[intcast_010:.+]] = bitcast i64* %[[byref_int_0]] to i8*
290290
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_1_011]], align 8
291291
; CHECK-NEXT: %[[fpcast_1_0:.+]] = bitcast double* %[[byref_fp_1_011]] to i8*
292-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast_010]], i8* %[[fpcast_1_0]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
292+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast_010]], i8* %[[fpcast_1_0]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
293293
; CHECK-NEXT: %[[r70:.+]] = bitcast double* %0 to i8*
294294
; CHECK-NEXT: tail call void @free(i8* nonnull %[[r70]])
295295
; CHECK-NEXT: ret void

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_c_split_lacpy.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ entry:
135135
; CHECK-NEXT: %byref.constant.int.0 = alloca i64
136136
; CHECK-NEXT: %[[int09:.+]] = alloca i64
137137
; CHECK-NEXT: %[[fp11:.+]] = alloca double
138-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
138+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
139139
; CHECK-NEXT: %ldc = alloca i64, i64 1, align 16
140140
; CHECK-NEXT: %[[i1:.+]] = bitcast i64* %ldc to i8*
141141
; CHECK-NEXT: %beta = alloca double, i64 1, align 16
@@ -263,7 +263,7 @@ entry:
263263
; CHECK-NEXT: %[[int010:.+]] = bitcast i64* %[[int09:.+]] to i8*
264264
; CHECK-NEXT: store double 1.000000e+00, double* %[[fp11]], align 8
265265
; CHECK-NEXT: %[[fp12:.+]] = bitcast double* %[[fp11]] to i8*
266-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[int010]], i8* %[[fp12]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
266+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[int010]], i8* %[[fp12]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
267267
; CHECK-NEXT: %[[r70:.+]] = bitcast double* %0 to i8*
268268
; CHECK-NEXT: tail call void @free(i8* nonnull %[[r70]])
269269
; CHECK-NEXT: ret void

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_c_split_transpose_lacpy.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ entry:
135135
; CHECK-NEXT: %byref.constant.int.0 = alloca i64, align 8
136136
; CHECK-NEXT: %[[byref_int_0:.+]] = alloca i64, align 8
137137
; CHECK-NEXT: %[[byref_fp_1_011:.+]] = alloca double, align 8
138-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
138+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
139139
; CHECK-NEXT: %ldc = alloca i64, i64 1, align 16
140140
; CHECK-NEXT: %[[i1:.+]] = bitcast i64* %ldc to i8*
141141
; CHECK-NEXT: %beta = alloca double, i64 1, align 16
@@ -261,7 +261,7 @@ entry:
261261
; CHECK-NEXT: %[[intcast_010:.+]] = bitcast i64* %[[byref_int_0]] to i8*
262262
; CHECK-NEXT: store double 1.000000e+00, double* %[[byref_fp_1_011]], align 8
263263
; CHECK-NEXT: %[[fpcast_1_012:.+]] = bitcast double* %[[byref_fp_1_011]] to i8*
264-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast_010]], i8* %[[fpcast_1_012]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
264+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[intcast_010]], i8* %[[fpcast_1_012]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
265265
; CHECK-NEXT: %[[r70:.+]] = bitcast double* %0 to i8*
266266
; CHECK-NEXT: tail call void @free(i8* nonnull %[[r70]])
267267
; CHECK-NEXT: ret void

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_c_transpose_lacpy.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ entry:
6161
; CHECK-NEXT: %byref.constant.int.0 = alloca i64
6262
; CHECK-NEXT: %[[int04:.+]] = alloca i64
6363
; CHECK-NEXT: %[[byref_fp_1_018:.+]] = alloca double
64-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
64+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
6565
; CHECK-NEXT: %transa = alloca i8, align 1
6666
; CHECK-NEXT: %transb = alloca i8, align 1
6767
; CHECK-NEXT: %m = alloca i64, align 16
@@ -219,7 +219,7 @@ entry:
219219
; CHECK-NEXT: %[[intcast08:.+]] = bitcast i64* %[[int04]] to i8*
220220
; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.0
221221
; CHECK-NEXT: %[[fp19:.+]] = bitcast double* %[[byref_fp_1_018]] to i8*
222-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %[[intcast0]], i8* %[[intcast08]], i8* %[[fp19]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
222+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %[[intcast0]], i8* %[[intcast08]], i8* %[[fp19]], i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
223223
; CHECK-NEXT: %[[free1:.+]] = bitcast double* %cache.A to i8*
224224
; CHECK-NEXT: tail call void @free(i8* nonnull %[[free1]])
225225
; CHECK-NEXT: %[[free2:.+]] = bitcast double* %cache.B to i8*

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_change_ld.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ entry:
5959
; CHECK-NEXT: %byref.constant.int.0 = alloca i64
6060
; CHECK-NEXT: %[[byrefint03:.+]] = alloca i64
6161
; CHECK-NEXT: %byref.constant.fp.1.06 = alloca double
62-
; CHECK-NEXT: %[[tmp:.+]] = alloca i8
62+
; CHECK-NEXT: %[[tmp:.+]] = alloca i64
6363
; CHECK-NEXT: %transa = alloca i8, align 1
6464
; CHECK-NEXT: %transb = alloca i8, align 1
6565
; CHECK-NEXT: %m = alloca i64, align 16
@@ -159,7 +159,7 @@ entry:
159159
; CHECK-NEXT: %intcast.constant.int.05 = bitcast i64* %byref.constant.int.04 to i8*
160160
; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.0
161161
; CHECK-NEXT: %fpcast.constant.fp.1.07 = bitcast double* %byref.constant.fp.1.06 to i8*
162-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %intcast.constant.int.05, i8* %fpcast.constant.fp.1.07, i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
162+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %intcast.constant.int.05, i8* %fpcast.constant.fp.1.07, i8* %beta_p, i8* %m_p, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
163163
; CHECK-NEXT: %[[ret:.+]] = bitcast double* %cache.B to i8*
164164
; CHECK-NEXT: tail call void @free(i8* nonnull %[[ret]])
165165
; CHECK-NEXT: ret void

enzyme/test/Enzyme/ReverseMode/blas/gemm_f_over.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ entry:
5959
; CHECK-DAG: %byref.constant.int.0 = alloca i64
6060
; CHECK-DAG: %[[byref_int_08:.+]] = alloca i64, align 8
6161
; CHECK-DAG: %[[byref_fp_1_010:.+]] = alloca double
62-
; CHECK-DAG: %[[tmp:.+]] = alloca i8
62+
; CHECK-DAG: %[[tmp:.+]] = alloca i64
6363
; CHECK-DAG: %transa = alloca i8, align 1
6464
; CHECK-DAG: %transb = alloca i8, align 1
6565
; CHECK-DAG: %m = alloca i64, align 16
@@ -164,6 +164,6 @@ entry:
164164
; CHECK-NEXT: %[[int02:.+]] = bitcast i64* %[[byref_int_08]] to i8*
165165
; CHECK-NEXT: store double 1.000000e+00, double* %byref.constant.fp.1.0
166166
; CHECK-NEXT: %[[fp11:.+]] = bitcast double* %[[byref_fp_1_010]] to i8*
167-
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[int02]], i8* %[[fp11]], i8* %beta_p, i8* %cast.m, i8* %n_p, i8* %"C'", i8* %ldc_p, i8* %[[tmp]], i64 1)
167+
; CHECK-NEXT: call void @dlascl_64_(i8* %byref.constant.char.G, i8* %intcast.constant.int.0, i8* %[[int02]], i8* %[[fp11]], i8* %beta_p, i8* %cast.m, i8* %n_p, i8* %"C'", i8* %ldc_p, i64* %[[tmp]], i64 1)
168168
; CHECK-NEXT: ret void
169169
; CHECK-NEXT: }

0 commit comments

Comments
 (0)