Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 13, 2024
1 parent 23d4e35 commit 75c3f62
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions enzyme/test/Enzyme/ReverseMode/mallocuse.ll
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,39 @@ define double @_take(ptr %a0, i1 %a1) {
store double %a9, ptr %a4, align 8
br label %.lr.ph
}

; CHECK: define internal { ptr, double } @augmented__take(ptr %a0, ptr %"a0'", i1 %a1)
; CHECK-NEXT: %malloccall = tail call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) ptr @malloc(i64 8)
; CHECK-NEXT: %a3 = tail call ptr @malloc(i64 10)
; CHECK-NEXT: %a4 = tail call ptr @malloc(i64 10)
; CHECK-NEXT: store ptr %a4, ptr %malloccall, align 8
; CHECK-NEXT: %a5 = ptrtoint ptr %a4 to i64
; CHECK-NEXT: %a6 = or i64 %a5, 1
; CHECK-NEXT: %a7 = inttoptr i64 %a6 to ptr
; CHECK-NEXT: %a8 = load double, ptr %a7, align 8
; CHECK-NEXT: store double %a8, ptr %a0, align 8
; CHECK-NEXT: br i1 %a1, label %.lr.ph, label %.lr.ph1.peel.next

; CHECK: .lr.ph1.peel.next: ; preds = %0
; CHECK-NEXT: %.pre = load double, ptr %a4, align 8, !alias.scope !10, !noalias !13
; CHECK-NEXT: %.fca.0.insert = insertvalue { ptr, double } poison, ptr %malloccall, 0
; CHECK-NEXT: %.fca.1.insert = insertvalue { ptr, double } %.fca.0.insert, double %.pre, 1
; CHECK-NEXT: ret { ptr, double } %.fca.1.insert

; CHECK: .lr.ph: ; preds = %0, %.lr.ph
; CHECK-NEXT: %a9 = load double, ptr %a3, align 4
; CHECK-NEXT: store double %a9, ptr %a4, align 8
; CHECK-NEXT: br label %.lr.ph
; CHECK-NEXT: }

; CHECK: define internal void @diffe_take(ptr %a0, ptr %"a0'", i1 %a1, double %differeturn, ptr %tapeArg)
; CHECK-NEXT: tail call void @free(ptr nonnull %tapeArg)
; CHECK-NEXT: br i1 %a1, label %.lr.ph, label %invert.lr.ph1.peel.next

; CHECK: .lr.ph: ; preds = %0, %.lr.ph
; CHECK-NEXT: br label %.lr.ph

; CHECK: invert.lr.ph1.peel.next: ; preds = %0
; CHECK-NEXT: store double 0.000000e+00, ptr %"a0'", align 8
; CHECK-NEXT: ret void
; CHECK-NEXT: }

0 comments on commit 75c3f62

Please sign in to comment.