Skip to content

Commit 0517244

Browse files
authored
Add willreturn (rust-lang#455)
1 parent 19ad3dd commit 0517244

File tree

137 files changed

+400
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+400
-298
lines changed

enzyme/Enzyme/FunctionUtils.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,37 @@ PreProcessCache::getAAResultsFromFunction(llvm::Function *NewF) {
932932
return FAM.getResult<AAManager>(*NewF);
933933
}
934934

935+
void setFullWillReturn(Function *NewF) {
936+
#if LLVM_VERSION_MAJOR >= 9
937+
for (auto &BB : *NewF) {
938+
for (auto &I : BB) {
939+
if (auto CI = dyn_cast<CallInst>(&I)) {
940+
#if LLVM_VERSION_MAJOR >= 14
941+
CI->addFnAttr(Attribute::WillReturn);
942+
CI->addFnAttr(Attribute::MustProgress);
943+
#elif LLVM_VERSION_MAJOR >= 12
944+
CI->addAttribute(AttributeList::FunctionIndex, Attribute::WillReturn);
945+
CI->addAttribute(AttributeList::FunctionIndex, Attribute::MustProgress);
946+
#else
947+
CI->addAttribute(AttributeList::FunctionIndex, Attribute::WillReturn);
948+
#endif
949+
}
950+
if (auto CI = dyn_cast<InvokeInst>(&I)) {
951+
#if LLVM_VERSION_MAJOR >= 14
952+
CI->addFnAttr(Attribute::WillReturn);
953+
CI->addFnAttr(Attribute::MustProgress);
954+
#elif LLVM_VERSION_MAJOR >= 12
955+
CI->addAttribute(AttributeList::FunctionIndex, Attribute::WillReturn);
956+
CI->addAttribute(AttributeList::FunctionIndex, Attribute::MustProgress);
957+
#else
958+
CI->addAttribute(AttributeList::FunctionIndex, Attribute::WillReturn);
959+
#endif
960+
}
961+
}
962+
}
963+
#endif
964+
}
965+
935966
Function *PreProcessCache::preprocessForClone(Function *F,
936967
DerivativeMode mode) {
937968

@@ -982,10 +1013,21 @@ Function *PreProcessCache::preprocessForClone(Function *F,
9821013
j->addAttr(Attribute::NoAlias);
9831014
}
9841015
}
1016+
#if LLVM_VERSION_MAJOR >= 14
1017+
NewF->addFnAttr(Attribute::WillReturn);
1018+
NewF->addFnAttr(Attribute::MustProgress);
1019+
#elif LLVM_VERSION_MAJOR >= 9
1020+
NewF->addAttribute(AttributeList::FunctionIndex, Attribute::WillReturn);
1021+
#if LLVM_VERSION_MAJOR >= 12
1022+
NewF->addAttribute(AttributeList::FunctionIndex, Attribute::MustProgress);
1023+
#endif
1024+
#endif
1025+
setFullWillReturn(NewF);
9851026

9861027
if (EnzymePreopt) {
9871028
if (EnzymeInline) {
9881029
ForceRecursiveInlining(NewF, /*Limit*/ EnzymeInlineCount);
1030+
setFullWillReturn(NewF);
9891031
PreservedAnalyses PA;
9901032
FAM.invalidate(*NewF, PA);
9911033
}

enzyme/test/Enzyme/ForwardMode/bitcast.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ entry:
1515

1616
declare double @__enzyme_fwddiff(double (double)*, ...)
1717

18-
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(double %x, double %"x'") {
18+
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(double %x, double %"x'")
1919
; CHECK-NEXT: entry:
2020
; CHECK-NEXT: ret double %"x'"
21-
; CHECK-NEXT: }
21+
; CHECK-NEXT: }

enzyme/test/Enzyme/ForwardMode/callmincacheunwrap.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ attributes #3 = { nounwind }
7373
!12 = !{!"double", !5, i64 0}
7474

7575

76-
; CHECK: define internal void @fwddiffesubcall(double** %m_data.i.i.i, double** %"m_data.i.i.i'", i64* %tmp7) local_unnamed_addr #2 {
76+
; CHECK: define internal void @fwddiffesubcall(double** %m_data.i.i.i, double** %"m_data.i.i.i'", i64* %tmp7)
7777
; CHECK-NEXT: entry:
7878
; CHECK-NEXT: %"mat'ipl" = load double*, double** %"m_data.i.i.i'", align 8
7979
; CHECK-NEXT: %mat = load double*, double** %m_data.i.i.i, align 8, !tbaa !8
80-
; CHECK-NEXT: %cols = call i64 @_ZNK5Eigen9EigenBaseINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE4colsEv(i64* %tmp7) #3
80+
; CHECK-NEXT: %cols = call i64 @_ZNK5Eigen9EigenBaseINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE4colsEv(i64* %tmp7)
8181
; CHECK-NEXT: br label %for.body
8282

8383
; CHECK: for.body: ; preds = %for.body, %entry

enzyme/test/Enzyme/ForwardMode/erf.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ entry:
1717
; Function Attrs: nounwind
1818
declare double @__enzyme_fwddiff(double (double)*, ...)
1919

20-
; CHECK: define internal double @fwddiffetester(double %x, double %"x'") {
20+
; CHECK: define internal double @fwddiffetester(double %x, double %"x'")
2121
; CHECK-NEXT: entry:
2222
; CHECK-NEXT: %0 = fmul fast double %x, %x
2323
; CHECK-NEXT: %1 = {{(fsub fast double \-?0.000000e\+00,|fneg fast double)}} %0

enzyme/test/Enzyme/ForwardMode/erfc.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ entry:
1717
; Function Attrs: nounwind
1818
declare double @__enzyme_fwddiff(double (double)*, ...)
1919

20-
; CHECK: define internal double @fwddiffetester(double %x, double %"x'") {
20+
; CHECK: define internal double @fwddiffetester(double %x, double %"x'")
2121
; CHECK-NEXT: entry:
2222
; CHECK-NEXT: %0 = fmul fast double %x, %x
2323
; CHECK-NEXT: %1 = {{(fsub fast double \-?0.000000e\+00,|fneg fast double)}} %0

enzyme/test/Enzyme/ForwardMode/erfi.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ entry:
1717
; Function Attrs: nounwind
1818
declare double @__enzyme_fwddiff(double (double)*, ...)
1919

20-
; CHECK: define internal double @fwddiffetester(double %x, double %"x'") {
20+
; CHECK: define internal double @fwddiffetester(double %x, double %"x'")
2121
; CHECK-NEXT: entry:
2222
; CHECK-NEXT: %0 = fmul fast double %x, %x
2323
; CHECK-NEXT: %1 = call fast double @llvm.exp.f64(double %0)

enzyme/test/Enzyme/ForwardMode/fneg.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ define double @dfneg(double %x) {
2424
declare double @__enzyme_fwddiff(double (double)*, double, double)
2525

2626

27-
; CHECK: define internal double @fwddiffefneg(double %x, double %"x'") {
27+
; CHECK: define internal double @fwddiffefneg(double %x, double %"x'")
2828
; CHECK-NEXT: %1 = fneg fast double %"x'"
2929
; CHECK-NEXT: ret double %1
30-
; CHECK-NEXT: }
30+
; CHECK-NEXT: }

enzyme/test/Enzyme/ForwardMode/fpext.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ entry:
1414

1515
declare double @__enzyme_fwddiff(double (float)*, ...)
1616

17-
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(float %x, float %"x'") {
17+
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(float %x, float %"x'")
1818
; CHECK-NEXT: entry:
1919
; CHECK-NEXT: %0 = fpext float %"x'" to double
2020
; CHECK-NEXT: ret double %0
21-
; CHECK-NEXT: }
21+
; CHECK-NEXT: }

enzyme/test/Enzyme/ForwardMode/memcpy-ptr.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ attributes #2 = { noinline nounwind uwtable }
2828
attributes #3 = { nounwind }
2929

3030

31-
; CHECK: define internal void @fwddiffememcpy_ptr(double** nocapture %dst, double** nocapture %"dst'", double** nocapture readonly %src, double** nocapture %"src'", i64 %num) #0 {
31+
; CHECK: define internal void @fwddiffememcpy_ptr(double** nocapture %dst, double** nocapture %"dst'", double** nocapture readonly %src, double** nocapture %"src'", i64 %num)
3232
; CHECK-NEXT: entry:
3333
; CHECK-NEXT: %"'ipc" = bitcast double** %"dst'" to i8*
3434
; CHECK-NEXT: %0 = bitcast double** %dst to i8*
@@ -37,4 +37,4 @@ attributes #3 = { nounwind }
3737
; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %num, i1 false)
3838
; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %"'ipc", i8* align 1 %"'ipc1", i64 %num, i1 false)
3939
; CHECK-NEXT: ret void
40-
; CHECK-NEXT: }
40+
; CHECK-NEXT: }

enzyme/test/Enzyme/ForwardMode/negbithack.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ entry:
1818
; Function Attrs: nounwind
1919
declare double @__enzyme_fwddiff(double (double)*, ...)
2020

21-
; CHECK: define internal double @fwddiffetester(double %x, double %"x'") {
21+
; CHECK: define internal double @fwddiffetester(double %x, double %"x'")
2222
; CHECK-NEXT: entry:
2323
; CHECK-NEXT: %0 = {{(fsub fast double \-?0.000000e\+00,|fneg fast double)}} %"x'"
2424
; CHECK-NEXT: ret double %0

enzyme/test/Enzyme/ForwardMode/negbithack2.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ entry:
1818
; Function Attrs: nounwind
1919
declare <2 x double> @__enzyme_fwddiff(<2 x double> (<2 x double>)*, ...)
2020

21-
; CHECK: define internal <2 x double> @fwddiffetester(<2 x double> %x, <2 x double> %"x'") {
21+
; CHECK: define internal <2 x double> @fwddiffetester(<2 x double> %x, <2 x double> %"x'")
2222
; CHECK-NEXT: entry:
2323
; CHECK-NEXT: %0 = {{(fsub fast <2 x double> <double \-?0.000000e\+00, double \-?0.000000e\+00>,|fneg fast <2 x double>)}} %"x'"
2424
; CHECK-NEXT: ret <2 x double> %0

enzyme/test/Enzyme/ForwardMode/negbithack3.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ entry:
1818
; Function Attrs: nounwind
1919
declare <2 x double> @__enzyme_fwddiff(<2 x double> (<2 x double>)*, ...)
2020

21-
; CHECK: define internal <2 x double> @fwddiffetester(<2 x double> %x, <2 x double> %"x'") {
21+
; CHECK: define internal <2 x double> @fwddiffetester(<2 x double> %x, <2 x double> %"x'")
2222
; CHECK-NEXT: entry:
2323
; CHECK-NEXT: %0 = bitcast <2 x double> %"x'" to <2 x i64>
2424
; CHECK-NEXT: %1 = extractelement <2 x i64> %0, i64 0

enzyme/test/Enzyme/ForwardMode/pow.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ declare double @llvm.pow.f64(double, double)
1919
; Function Attrs: nounwind
2020
declare double @__enzyme_fwddiff(double (double, double)*, ...)
2121

22-
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(double %x, double %"x'", double %y, double %"y'") {
22+
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(double %x, double %"x'", double %y, double %"y'")
2323
; CHECK-NEXT: entry:
2424
; CHECK-NEXT: %[[i0:.+]] = fsub fast double %y, 1.000000e+00
2525
; CHECK-NEXT: %[[i1:.+]] = call fast double @llvm.pow.f64(double %x, double %[[i0]])

enzyme/test/Enzyme/ForwardMode/powi13.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ declare double @llvm.powi.f64.i32(double, i32)
1919
; Function Attrs: nounwind
2020
declare double @__enzyme_fwddiff(double (double, i32)*, ...)
2121

22-
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(double %x, double %"x'", i32 %y) {
22+
; CHECK: define internal {{(dso_local )?}}double @fwddiffetester(double %x, double %"x'", i32 %y)
2323
; CHECK-NEXT: entry:
2424
; CHECK-NEXT: %[[ym1:.+]] = sub i32 %y, 1
2525
; CHECK-NEXT: %[[newpow:.+]] = call fast double @llvm.powi.f64.i32(double %x, i32 %[[ym1]])

enzyme/test/Enzyme/ForwardMode/sqrelu.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ attributes #3 = { nounwind }
5454
; CHECK-NEXT: br i1 %cmp.i, label %cond.true.i, label %fwddiffesqrelu.exit
5555

5656
; CHECK: cond.true.i:
57-
; CHECK-NEXT: %0 = call fast double @llvm.sin.f64(double %x) #3
58-
; CHECK-NEXT: %1 = call fast double @llvm.cos.f64(double %x) #3
57+
; CHECK-NEXT: %0 = call fast double @llvm.sin.f64(double %x)
58+
; CHECK-NEXT: %1 = call fast double @llvm.cos.f64(double %x)
5959
; CHECK-NEXT: %mul.i = fmul fast double %0, %x
6060
; CHECK-NEXT: %2 = fmul fast double %1, %x
6161
; CHECK-NEXT: %3 = fadd fast double %2, %0
62-
; CHECK-NEXT: %4 = call fast double @llvm.sqrt.f64(double %mul.i) #3
62+
; CHECK-NEXT: %4 = call fast double @llvm.sqrt.f64(double %mul.i)
6363
; CHECK-NEXT: %5 = fmul fast double %3, 5.000000e-01
6464
; CHECK-NEXT: %6 = fdiv fast double %5, %4
6565
; CHECK-NEXT: %7 = fcmp fast oeq double %mul.i, 0.000000e+00

enzyme/test/Enzyme/ForwardMode/sret.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ attributes #6 = { nounwind }
8181
; CHECK-NEXT: }
8282

8383

84-
; CHECK: define internal void @fwddiffe_Z6squared(%"struct.std::array"* noalias nocapture %agg.result, %"struct.std::array"* nocapture %"agg.result'", double %x, double %"x'") #0 {
84+
; CHECK: define internal void @fwddiffe_Z6squared(%"struct.std::array"* noalias nocapture %agg.result, %"struct.std::array"* nocapture %"agg.result'", double %x, double %"x'")
8585
; CHECK-NEXT: entry:
8686
; CHECK-NEXT: %"arrayinit.begin'ipg" = getelementptr inbounds %"struct.std::array", %"struct.std::array"* %"agg.result'", i64 0, i32 0, i64 0
8787
; CHECK-NEXT: %arrayinit.begin = getelementptr inbounds %"struct.std::array", %"struct.std::array"* %agg.result, i64 0, i32 0, i64 0
@@ -103,4 +103,4 @@ attributes #6 = { nounwind }
103103
; CHECK-NEXT: store double %x, double* %arrayinit.element3, align 8
104104
; CHECK-NEXT: store double %"x'", double* %"arrayinit.element3'ipg", align 8
105105
; CHECK-NEXT: ret void
106-
; CHECK-NEXT: }
106+
; CHECK-NEXT: }

enzyme/test/Enzyme/ForwardMode/storeconstexpr.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ entry:
1717
; Function Attrs: alwaysinline
1818
declare double @__enzyme_fwddiff(i8*, ...)
1919

20-
; CHECK: define internal void @fwddiffecallee(i64* %from, i64* %"from'", i64* %to, i64* %"to'") {
20+
; CHECK: define internal void @fwddiffecallee(i64* %from, i64* %"from'", i64* %to, i64* %"to'")
2121
; CHECK-NEXT: entry:
2222
; CHECK-NEXT: store i64 ptrtoint ([18 x i8]* @.str to i64), i64* %"to'", align 4
2323
; CHECK-NEXT: store i64 ptrtoint ([18 x i8]* @.str to i64), i64* %to, align 4
2424
; CHECK-NEXT: ret void
25-
; CHECK-NEXT: }
25+
; CHECK-NEXT: }

enzyme/test/Enzyme/ForwardMode/sumsimpleoptnone.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare dso_local double @__enzyme_fwddiff(i8*, double*, double*, double**, doub
3737
attributes #0 = { noinline nounwind uwtable optnone }
3838

3939

40-
; CHECK: define internal void @fwddiffef(double* %x, double* %"x'", double** %y, double** %"y'", i64 %n) #1 {
40+
; CHECK: define internal void @fwddiffef(double* %x, double* %"x'", double** %y, double** %"y'", i64 %n)
4141
; CHECK-NEXT: entry:
4242
; CHECK-NEXT: %0 = add nuw i64 %n, 1
4343
; CHECK-NEXT: br label %for.cond
@@ -63,4 +63,4 @@ attributes #0 = { noinline nounwind uwtable optnone }
6363

6464
; CHECK: for.end: ; preds = %for.cond
6565
; CHECK-NEXT: ret void
66-
; CHECK-NEXT: }
66+
; CHECK-NEXT: }

enzyme/test/Enzyme/ReverseMode/Faddeeva_erf.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ entry:
1717
; Function Attrs: nounwind
1818
declare { double, double } @__enzyme_autodiff({ double, double } ({ double, double })*, ...)
1919

20-
; CHECK: define internal { { double, double } } @diffetester({ double, double } %in, { double, double } %differeturn) {
20+
; CHECK: define internal { { double, double } } @diffetester({ double, double } %in, { double, double } %differeturn)
2121
; CHECK-NEXT: entry:
2222
; CHECK-NEXT: %0 = extractvalue { double, double } %in, 0
2323
; CHECK-NEXT: %1 = extractvalue { double, double } %in, 1

enzyme/test/Enzyme/ReverseMode/Faddeeva_erfc.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ entry:
1717
; Function Attrs: nounwind
1818
declare { double, double } @__enzyme_autodiff({ double, double } ({ double, double })*, ...)
1919

20-
; CHECK: define internal { { double, double } } @diffetester({ double, double } %in, { double, double } %differeturn) {
20+
; CHECK: define internal { { double, double } } @diffetester({ double, double } %in, { double, double } %differeturn)
2121
; CHECK-NEXT: entry:
2222
; CHECK-NEXT: %0 = extractvalue { double, double } %in, 0
2323
; CHECK-NEXT: %1 = extractvalue { double, double } %in, 1

enzyme/test/Enzyme/ReverseMode/Faddeeva_erfi.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ entry:
1717
; Function Attrs: nounwind
1818
declare { double, double } @__enzyme_autodiff({ double, double } ({ double, double })*, ...)
1919

20-
; CHECK: define internal { { double, double } } @diffetester({ double, double } %in, { double, double } %differeturn) {
20+
; CHECK: define internal { { double, double } } @diffetester({ double, double } %in, { double, double } %differeturn)
2121
; CHECK-NEXT: entry:
2222
; CHECK-NEXT: %0 = extractvalue { double, double } %in, 0
2323
; CHECK-NEXT: %1 = extractvalue { double, double } %in, 1

enzyme/test/Enzyme/ReverseMode/allocacache.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ attributes #11 = { cold }
439439
!8 = !{!9, !9, i64 0}
440440
!9 = !{!"double", !3, i64 0}
441441

442-
; CHECK: define internal void @diffematvec(<2 x double>* %Wptr, <2 x double>* %"Wptr'", double* %B, double* %"B'", <2 x double>* %outvec, <2 x double>* %"outvec'") #3 {
442+
; CHECK: define internal void @diffematvec(<2 x double>* %Wptr, <2 x double>* %"Wptr'", double* %B, double* %"B'", <2 x double>* %outvec, <2 x double>* %"outvec'")
443443
; CHECK-NEXT: entry:
444444
; CHECK-NEXT: %B1 = load double, double* %B, align 8
445445
; CHECK-NEXT: %[[B2pprime:.+]] = getelementptr inbounds double, double* %"B'", i64 1
@@ -462,7 +462,7 @@ attributes #11 = { cold }
462462
; CHECK-NEXT: ret void
463463
; CHECK-NEXT: }
464464

465-
; CHECK: define internal { <2 x double> } @diffecopy(<2 x double>* %to, <2 x double>* %"to'", <2 x double> %from) #4 {
465+
; CHECK: define internal { <2 x double> } @diffecopy(<2 x double>* %to, <2 x double>* %"to'", <2 x double> %from)
466466
; CHECK-NEXT: entry:
467467
; CHECK-NEXT: store <2 x double> %from, <2 x double>* %to, align 16
468468
; CHECK-NEXT: %0 = load <2 x double>, <2 x double>* %"to'", align 16
@@ -471,7 +471,7 @@ attributes #11 = { cold }
471471
; CHECK-NEXT: ret { <2 x double> } %1
472472
; CHECK-NEXT: }
473473

474-
; CHECK: define internal { <2 x double>, <2 x double> } @augmented_loadmul(<2 x double>* %a, <2 x double>* %"a'", <2 x double>* %b, <2 x double>* %"b'") #4 {
474+
; CHECK: define internal { <2 x double>, <2 x double> } @augmented_loadmul(<2 x double>* %a, <2 x double>* %"a'", <2 x double>* %b, <2 x double>* %"b'")
475475
; CHECK-NEXT: entry:
476476
; CHECK-NEXT: %0 = load <2 x double>, <2 x double>* %a, align 16
477477
; CHECK-NEXT: %1 = load <2 x double>, <2 x double>* %b, align 16
@@ -481,7 +481,7 @@ attributes #11 = { cold }
481481
; CHECK-NEXT: ret { <2 x double>, <2 x double> } %.fca.1.insert
482482
; CHECK-NEXT: }
483483

484-
; CHECK: define internal { { <2 x double>, i8*, i8*, <2 x double> }, <2 x double> } @augmented_subfn(<2 x double>* %W, <2 x double>* %"W'", double %B1, double %B2, i64 %row) #8 {
484+
; CHECK: define internal { { <2 x double>, i8*, i8*, <2 x double> }, <2 x double> } @augmented_subfn(<2 x double>* %W, <2 x double>* %"W'", double %B1, double %B2, i64 %row)
485485
; CHECK-NEXT: entry:
486486
; CHECK-NEXT: %malloccall = tail call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16)
487487
; CHECK-NEXT: %"malloccall'mi" = tail call noalias nonnull dereferenceable(16) dereferenceable_or_null(16) i8* @malloc(i64 16)
@@ -509,7 +509,7 @@ attributes #11 = { cold }
509509
; CHECK-NEXT: ret { { <2 x double>, i8*, i8*, <2 x double> }, <2 x double> } %.fca.1.insert
510510
; CHECK-NEXT: }
511511

512-
; CHECK: define internal { double, double } @diffesubfn(<2 x double>* %W, <2 x double>* %"W'", double %B1, double %B2, i64 %row, <2 x double> %differeturn, { <2 x double>, i8*, i8*, <2 x double> } %tapeArg) #8 {
512+
; CHECK: define internal { double, double } @diffesubfn(<2 x double>* %W, <2 x double>* %"W'", double %B1, double %B2, i64 %row, <2 x double> %differeturn, { <2 x double>, i8*, i8*, <2 x double> } %tapeArg)
513513
; CHECK-NEXT: entry:
514514
; CHECK-NEXT: %[[malloccall:.+]] = extractvalue { <2 x double>, i8*, i8*, <2 x double> } %tapeArg, 2
515515
; CHECK-NEXT: %[[malloccallmi:.+]] = extractvalue { <2 x double>, i8*, i8*, <2 x double> } %tapeArg, 1

enzyme/test/Enzyme/ReverseMode/alloclut.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ entry:
4848

4949
declare double @__enzyme_autodiff(double (double, i32*)*, ...)
5050

51-
; CHECK: define internal { double } @diffef(double %x, i32* %z, double %differeturn) {
51+
; CHECK: define internal { double } @diffef(double %x, i32* %z, double %differeturn)
5252
; CHECK-NEXT: entry:
5353
; CHECK-NEXT: %"a'ipa" = alloca [2 x double]
5454
; CHECK-NEXT: store [2 x double] zeroinitializer, [2 x double]* %"a'ipa"
@@ -123,4 +123,4 @@ declare double @__enzyme_autodiff(double (double, i32*)*, ...)
123123
; CHECK: mergeinvertloop1_exit: ; preds = %loop1
124124
; CHECK-NEXT: %"g1'ipg_unwrap" = getelementptr [2 x double], [2 x double]* %"a'ipa", i64 0, i32 1
125125
; CHECK-NEXT: br label %invertcleanup
126-
; CHECK-NEXT: }
126+
; CHECK-NEXT: }

0 commit comments

Comments
 (0)