EnzymeAD / Enzyme.jl

Julia bindings for the Enzyme automatic differentiator
https://enzyme.mit.edu
MIT License
455 stars 63 forks source link

`middle` from `Statistics` errors in reverse mode #876

Closed jgreener64 closed 1 year ago

jgreener64 commented 1 year ago

I am on Julia 1.8.5 and Enzyme 16818fd3d39d0583915aee38595b54a7fcce6b58. The following errors, though forward mode works.

using Enzyme, Statistics
f(x) = middle([2.0, x, 1.0])
autodiff(Reverse, f, Active, Active(3.0))
; Function Attrs: mustprogress uwtable willreturn
define internal fastcc void @preprocess_julia__mapreduce_4192([2 x double]* noalias nocapture nofree noundef nonnull writeonly sret([2 x double]) align 8 dereferenceable(16) %0, {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %1) unnamed_addr #10 !dbg !401 {
top:
  %2 = alloca [2 x double], align 8
  %3 = call {}*** @julia.get_pgcstack() #12
  %4 = bitcast {} addrspace(10)* %1 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !402
  %5 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %4 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !402
  %6 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %5, i64 0, i32 1, !dbg !402
  %7 = load i64, i64 addrspace(11)* %6, align 8, !dbg !402, !tbaa !21, !range !26
  switch i64 %7, label %L14 [
    i64 0, label %L7
    i64 1, label %L11
  ], !dbg !406

L7:                                               ; preds = %top
  %8 = call cc38 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* @ijl_invoke to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* addrspacecast ({}* inttoptr (i64 1506326766992 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719551958320 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719555571088 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719550211824 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %1, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719548133760 to {}*) to {} addrspace(10)*)) #12, !dbg !407
  unreachable, !dbg !407

common.ret:                                       ; preds = %L97, %L96, %L11
  ret void, !dbg !408

L11:                                              ; preds = %top
  %9 = bitcast {} addrspace(10)* %1 to double addrspace(13)* addrspace(10)*, !dbg !409
  %10 = addrspacecast double addrspace(13)* addrspace(10)* %9 to double addrspace(13)* addrspace(11)*, !dbg !409
  %11 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %10, align 16, !dbg !409, !tbaa !33, !alias.scope !411, !nonnull !4
  %12 = load double, double addrspace(13)* %11, align 8, !dbg !409, !tbaa !38
  %.sroa.0.0..sroa_idx = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0, !dbg !414
  store double %12, double* %.sroa.0.0..sroa_idx, align 8, !dbg !414, !noalias !411
  %.sroa.2.0..sroa_idx12 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 1, !dbg !414
  store double %12, double* %.sroa.2.0..sroa_idx12, align 8, !dbg !414, !noalias !411
  br label %common.ret

L14:                                              ; preds = %top
  %13 = icmp ugt i64 %7, 15, !dbg !415
  br i1 %13, label %L97, label %L16, !dbg !416

L16:                                              ; preds = %L14
  %14 = bitcast {} addrspace(10)* %1 to double addrspace(13)* addrspace(10)*, !dbg !417
  %15 = addrspacecast double addrspace(13)* addrspace(10)* %14 to double addrspace(13)* addrspace(11)*, !dbg !417
  %16 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %15, align 16, !dbg !417, !tbaa !33, !alias.scope !411, !nonnull !4
  %17 = load double, double addrspace(13)* %16, align 8, !dbg !417, !tbaa !38
  %18 = getelementptr inbounds double, double addrspace(13)* %16, i64 1, !dbg !419
  %19 = load double, double addrspace(13)* %18, align 8, !dbg !419, !tbaa !38
  %20 = fcmp olt double %19, %17, !dbg !421
  %21 = bitcast double %19 to i64, !dbg !425
  %22 = bitcast double %17 to i64, !dbg !425
  %.lobit = lshr i64 %22, 63, !dbg !426
  %23 = trunc i64 %.lobit to i8, !dbg !426
  %24 = xor i8 %23, -1, !dbg !426
  %.lobit20 = lshr i64 %21, 63, !dbg !429
  %25 = trunc i64 %.lobit20 to i8, !dbg !429
  %26 = and i8 %25, %24, !dbg !429
  %27 = zext i1 %20 to i8, !dbg !430
  %28 = or i8 %26, %27, !dbg !430
  %.not21 = icmp eq i8 %28, 0, !dbg !430
  %29 = fcmp ord double %17, 0.000000e+00, !dbg !431
  %30 = select i1 %29, double %19, double %17, !dbg !433
  %31 = fcmp ord double %19, 0.000000e+00, !dbg !431
  %32 = select i1 %31, double %17, double %19, !dbg !433
  %33 = select i1 %.not21, double %32, double %30, !dbg !433
  %34 = fcmp olt double %17, %19, !dbg !434
  %35 = xor i8 %25, -1, !dbg !437
  %36 = and i8 %35, %23, !dbg !439
  %37 = zext i1 %34 to i8, !dbg !440
  %38 = or i8 %36, %37, !dbg !440
  %.not22 = icmp eq i8 %38, 0, !dbg !440
  %39 = select i1 %.not22, double %32, double %30, !dbg !441
  %.not2345 = icmp ugt i64 %7, 2, !dbg !442
  br i1 %.not2345, label %L60.preheader, label %L96, !dbg !443

L60.preheader:                                    ; preds = %L16
  br label %L60, !dbg !443

L60:                                              ; preds = %L60.preheader, %L60
  %iv = phi i64 [ 0, %L60.preheader ], [ %iv.next, %L60 ]
  %value_phi147 = phi double [ %68, %L60 ], [ %39, %L60.preheader ]
  %value_phi46 = phi double [ %57, %L60 ], [ %33, %L60.preheader ]
  %40 = add i64 %iv, 2, !dbg !444
  %iv.next = add nuw nsw i64 %iv, 1, !dbg !444
  %41 = add nuw nsw i64 %40, 1, !dbg !444
  %42 = getelementptr inbounds double, double addrspace(13)* %16, i64 %40, !dbg !446
  %43 = load double, double addrspace(13)* %42, align 8, !dbg !446, !tbaa !38
  %44 = fcmp olt double %43, %value_phi46, !dbg !447
  %45 = bitcast double %43 to i64, !dbg !451
  %46 = bitcast double %value_phi46 to i64, !dbg !451
  %.lobit24 = lshr i64 %46, 63, !dbg !452
  %47 = trunc i64 %.lobit24 to i8, !dbg !452
  %48 = xor i8 %47, -1, !dbg !452
  %.lobit25 = lshr i64 %45, 63, !dbg !455
  %49 = trunc i64 %.lobit25 to i8, !dbg !455
  %50 = and i8 %49, %48, !dbg !455
  %51 = zext i1 %44 to i8, !dbg !456
  %52 = or i8 %50, %51, !dbg !456
  %.not26 = icmp eq i8 %52, 0, !dbg !456
  %53 = fcmp ord double %value_phi46, 0.000000e+00, !dbg !457
  %54 = select i1 %53, double %43, double %value_phi46, !dbg !459
  %55 = fcmp ord double %43, 0.000000e+00, !dbg !457
  %56 = select i1 %55, double %value_phi46, double %43, !dbg !459
  %57 = select i1 %.not26, double %56, double %54, !dbg !459
  %58 = fcmp olt double %value_phi147, %43, !dbg !460
  %59 = bitcast double %value_phi147 to i64, !dbg !463
  %60 = xor i8 %49, -1, !dbg !464
  %.lobit27 = lshr i64 %59, 63, !dbg !466
  %61 = trunc i64 %.lobit27 to i8, !dbg !466
  %62 = and i8 %60, %61, !dbg !466
  %63 = zext i1 %58 to i8, !dbg !467
  %64 = or i8 %62, %63, !dbg !467
  %.not28 = icmp eq i8 %64, 0, !dbg !467
  %65 = fcmp ord double %value_phi147, 0.000000e+00, !dbg !468
  %66 = select i1 %65, double %43, double %value_phi147, !dbg !470
  %67 = select i1 %55, double %value_phi147, double %43, !dbg !470
  %68 = select i1 %.not28, double %67, double %66, !dbg !470
  %exitcond.not = icmp eq i64 %41, %7, !dbg !442
  br i1 %exitcond.not, label %L96.loopexit, label %L60, !dbg !443

L96.loopexit:                                     ; preds = %L60
  br label %L96, !dbg !471

L96:                                              ; preds = %L96.loopexit, %L16
  %value_phi.lcssa = phi double [ %33, %L16 ], [ %57, %L96.loopexit ]
  %value_phi1.lcssa = phi double [ %39, %L16 ], [ %68, %L96.loopexit ]
  %.sroa.040.0..sroa_idx = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0, !dbg !471
  store double %value_phi.lcssa, double* %.sroa.040.0..sroa_idx, align 8, !dbg !471, !noalias !411
  %.sroa.241.0..sroa_idx42 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 1, !dbg !471
  store double %value_phi1.lcssa, double* %.sroa.241.0..sroa_idx42, align 8, !dbg !471, !noalias !411
  br label %common.ret

L97:                                              ; preds = %L14
  call fastcc void @julia_mapreduce_impl_4195([2 x double]* noalias nocapture nofree noundef nonnull writeonly sret([2 x double]) align 8 dereferenceable(16) %2, {} addrspace(10)* nocapture nofree noundef nonnull readonly align 16 dereferenceable(40) %1, i64 noundef signext 1, i64 signext %7) #13, !dbg !472
  %69 = bitcast [2 x double]* %0 to i8*, !dbg !473
  %70 = bitcast [2 x double]* %2 to i8*, !dbg !473
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) %69, i8* noundef nonnull align 8 dereferenceable(16) %70, i64 noundef 16, i1 noundef false) #12, !dbg !473, !noalias !411
  br label %common.ret
}

; Function Attrs: mustprogress uwtable willreturn
define internal fastcc void @diffejulia__mapreduce_4192([2 x double]* noalias nocapture nofree writeonly sret([2 x double]) align 8 dereferenceable(16) "enzyme_sret" %0, [2 x double]* nocapture "enzyme_sret" %"'", {} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %1, {} addrspace(10)* %"'1") unnamed_addr #10 !dbg !474 {
top:
  %"'ipa" = alloca [2 x double], align 8
  store [2 x double] zeroinitializer, [2 x double]* %"'ipa", align 8
  %_replacementA = phi [2 x double]*
  %2 = call {}*** @julia.get_pgcstack() #12
  %3 = bitcast {} addrspace(10)* %1 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !475
  %4 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %3 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !475
  %5 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %4, i64 0, i32 1, !dbg !475
  %6 = load i64, i64 addrspace(11)* %5, align 8, !dbg !475, !tbaa !21, !range !26, !alias.scope !479, !noalias !482
  switch i64 %6, label %L14 [
    i64 0, label %L7
    i64 1, label %L11
  ], !dbg !484

L7:                                               ; preds = %top
  %7 = call cc38 nonnull {} addrspace(10)* bitcast ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* @ijl_invoke to {} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*)*)({} addrspace(10)* addrspacecast ({}* inttoptr (i64 1506326766992 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719551958320 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719555571088 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719550211824 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %1, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 140719548133760 to {}*) to {} addrspace(10)*)) #12, !dbg !485
  unreachable

common.ret:                                       ; preds = %L97, %L96, %L11
  br label %invertcommon.ret, !dbg !486

L11:                                              ; preds = %top
  %"'ipc" = bitcast {} addrspace(10)* %"'1" to double addrspace(13)* addrspace(10)*, !dbg !487
  %_replacementA7 = phi double addrspace(13)* addrspace(10)* , !dbg !487
  %"'ipc3" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc" to double addrspace(13)* addrspace(11)*, !dbg !487
  %_replacementA6 = phi double addrspace(13)* addrspace(11)* , !dbg !487
  %"'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc3", align 16, !dbg !487, !tbaa !33, !alias.scope !489, !noalias !479, !nonnull !4
  %_replacementA5 = phi double addrspace(13)* , !dbg !487
  %_replacementA4 = phi double , !dbg !487
  %".sroa.0.0..sroa_idx'ipg" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 0, !dbg !490
  %.sroa.0.0..sroa_idx_replacementA = phi double* , !dbg !490
  %".sroa.2.0..sroa_idx12'ipg" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 1, !dbg !490
  %.sroa.2.0..sroa_idx12_replacementA = phi double* , !dbg !490
  store i8 0, i8* %_cache, align 1, !invariant.group !491
  br label %common.ret

L14:                                              ; preds = %top
  %8 = icmp ugt i64 %6, 15, !dbg !492
  br i1 %8, label %L97, label %L16, !dbg !493

L16:                                              ; preds = %L14
  %"'ipc42" = bitcast {} addrspace(10)* %"'1" to double addrspace(13)* addrspace(10)*, !dbg !494
  %9 = bitcast {} addrspace(10)* %1 to double addrspace(13)* addrspace(10)*, !dbg !494
  %"'ipc43" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc42" to double addrspace(13)* addrspace(11)*, !dbg !494
  %10 = addrspacecast double addrspace(13)* addrspace(10)* %9 to double addrspace(13)* addrspace(11)*, !dbg !494
  %"'ipl44" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc43", align 16, !dbg !494, !tbaa !33, !alias.scope !489, !noalias !479, !nonnull !4, !invariant.group !496
  %11 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %10, align 16, !dbg !494, !tbaa !33, !alias.scope !497, !noalias !482, !nonnull !4, !invariant.group !498
  %12 = load double, double addrspace(13)* %11, align 8, !dbg !494, !tbaa !38, !alias.scope !499, !noalias !502, !invariant.group !504
  %"'ipg" = getelementptr inbounds double, double addrspace(13)* %"'ipl44", i64 1, !dbg !505
  %13 = getelementptr inbounds double, double addrspace(13)* %11, i64 1, !dbg !505
  %14 = load double, double addrspace(13)* %13, align 8, !dbg !505, !tbaa !38, !alias.scope !499, !noalias !502, !invariant.group !507
  %15 = fcmp olt double %14, %12, !dbg !508
  %16 = bitcast double %14 to i64, !dbg !512
  %17 = bitcast double %12 to i64, !dbg !512
  %.lobit = lshr i64 %17, 63, !dbg !513
  %18 = trunc i64 %.lobit to i8, !dbg !513
  %19 = xor i8 %18, -1, !dbg !513
  %.lobit20 = lshr i64 %16, 63, !dbg !516
  %20 = trunc i64 %.lobit20 to i8, !dbg !516
  %21 = and i8 %20, %19, !dbg !516
  %22 = zext i1 %15 to i8, !dbg !517
  %23 = or i8 %21, %22, !dbg !517
  %.not21 = icmp eq i8 %23, 0, !dbg !517
  %24 = fcmp ord double %12, 0.000000e+00, !dbg !518
  %25 = select i1 %24, double %14, double %12, !dbg !520
  %26 = fcmp ord double %14, 0.000000e+00, !dbg !518
  %27 = select i1 %26, double %12, double %14, !dbg !520
  %28 = select i1 %.not21, double %27, double %25, !dbg !520
  %29 = fcmp olt double %12, %14, !dbg !521
  %30 = xor i8 %20, -1, !dbg !524
  %31 = and i8 %30, %18, !dbg !526
  %32 = zext i1 %29 to i8, !dbg !527
  %33 = or i8 %31, %32, !dbg !527
  %.not22 = icmp eq i8 %33, 0, !dbg !527
  %34 = select i1 %.not22, double %27, double %25, !dbg !528
  %.not2345 = icmp ugt i64 %6, 2, !dbg !529
  br i1 %.not2345, label %L60.preheader, label %L96, !dbg !530

L60.preheader:                                    ; preds = %L16
  %35 = add nsw i64 %6, -3, !dbg !530
  %36 = add nuw i64 %35, 1, !dbg !530
  %37 = mul nuw i64 %36, 8, !dbg !530
  %38 = call noalias nonnull i8* @malloc(i64 %37), !dbg !530, !enzyme_cache_alloc !531
  %value_phi147_malloccache = bitcast i8* %38 to double*, !dbg !530
  store double* %value_phi147_malloccache, double** %value_phi147_cache, align 8, !dbg !530, !invariant.group !533
  %39 = mul nuw i64 %36, 8, !dbg !530
  %40 = call noalias nonnull i8* @malloc(i64 %39), !dbg !530, !enzyme_cache_alloc !534
  %value_phi46_malloccache = bitcast i8* %40 to double*, !dbg !530
  store double* %value_phi46_malloccache, double** %value_phi46_cache, align 8, !dbg !530, !invariant.group !536
  br label %L60, !dbg !530

L60:                                              ; preds = %L60, %L60.preheader
  %iv = phi i64 [ 0, %L60.preheader ], [ %iv.next, %L60 ]
  %value_phi147 = phi double [ %73, %L60 ], [ %34, %L60.preheader ]
  %value_phi46 = phi double [ %62, %L60 ], [ %28, %L60.preheader ]
  %41 = load double*, double** %value_phi147_cache, align 8, !dbg !537, !dereferenceable !539, !invariant.group !533
  %42 = getelementptr inbounds double, double* %41, i64 %iv, !dbg !537
  store double %value_phi147, double* %42, align 8, !dbg !537, !invariant.group !540
  %43 = load double*, double** %value_phi46_cache, align 8, !dbg !537, !dereferenceable !539, !invariant.group !536
  %44 = getelementptr inbounds double, double* %43, i64 %iv, !dbg !537
  store double %value_phi46, double* %44, align 8, !dbg !537, !invariant.group !541
  %iv.next = add nuw nsw i64 %iv, 1, !dbg !537
  %45 = add i64 %iv, 2, !dbg !537
  %46 = add nuw nsw i64 %45, 1, !dbg !537
  %"'ipg89" = getelementptr inbounds double, double addrspace(13)* %"'ipl44", i64 %45, !dbg !542
  %47 = getelementptr inbounds double, double addrspace(13)* %11, i64 %45, !dbg !542
  %48 = load double, double addrspace(13)* %47, align 8, !dbg !542, !tbaa !38, !alias.scope !499, !noalias !502, !invariant.group !543
  %49 = fcmp olt double %48, %value_phi46, !dbg !544
  %50 = bitcast double %48 to i64, !dbg !548
  %51 = bitcast double %value_phi46 to i64, !dbg !548
  %.lobit24 = lshr i64 %51, 63, !dbg !549
  %52 = trunc i64 %.lobit24 to i8, !dbg !549
  %53 = xor i8 %52, -1, !dbg !549
  %.lobit25 = lshr i64 %50, 63, !dbg !552
  %54 = trunc i64 %.lobit25 to i8, !dbg !552
  %55 = and i8 %54, %53, !dbg !552
  %56 = zext i1 %49 to i8, !dbg !553
  %57 = or i8 %55, %56, !dbg !553
  %.not26 = icmp eq i8 %57, 0, !dbg !553
  %58 = fcmp ord double %value_phi46, 0.000000e+00, !dbg !554
  %59 = select i1 %58, double %48, double %value_phi46, !dbg !556
  %60 = fcmp ord double %48, 0.000000e+00, !dbg !554
  %61 = select i1 %60, double %value_phi46, double %48, !dbg !556
  %62 = select i1 %.not26, double %61, double %59, !dbg !556
  %63 = fcmp olt double %value_phi147, %48, !dbg !557
  %64 = bitcast double %value_phi147 to i64, !dbg !560
  %65 = xor i8 %54, -1, !dbg !561
  %.lobit27 = lshr i64 %64, 63, !dbg !563
  %66 = trunc i64 %.lobit27 to i8, !dbg !563
  %67 = and i8 %65, %66, !dbg !563
  %68 = zext i1 %63 to i8, !dbg !564
  %69 = or i8 %67, %68, !dbg !564
  %.not28 = icmp eq i8 %69, 0, !dbg !564
  %70 = fcmp ord double %value_phi147, 0.000000e+00, !dbg !565
  %71 = select i1 %70, double %48, double %value_phi147, !dbg !567
  %72 = select i1 %60, double %value_phi147, double %48, !dbg !567
  %73 = select i1 %.not28, double %72, double %71, !dbg !567
  %exitcond.not = icmp eq i64 %46, %6, !dbg !529
  br i1 %exitcond.not, label %L96.loopexit, label %L60, !dbg !530

L96.loopexit:                                     ; preds = %L60
  br label %L96, !dbg !568

L96:                                              ; preds = %L96.loopexit, %L16
  %value_phi.lcssa_replacementA = phi double
  %value_phi1.lcssa_replacementA = phi double
  %".sroa.040.0..sroa_idx'ipg" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 0, !dbg !568
  %.sroa.040.0..sroa_idx_replacementA = phi double* , !dbg !568
  %".sroa.241.0..sroa_idx42'ipg" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 1, !dbg !568
  %.sroa.241.0..sroa_idx42_replacementA = phi double* , !dbg !568
  store i8 2, i8* %_cache, align 1, !invariant.group !491
  br label %common.ret

L97:                                              ; preds = %L14
  call fastcc void @julia_mapreduce_impl_4195([2 x double]* noalias nocapture nofree noundef nonnull writeonly sret([2 x double]) align 8 dereferenceable(16) %_replacementA, {} addrspace(10)* nocapture nofree noundef nonnull readonly align 16 dereferenceable(40) %1, i64 noundef signext 1, i64 signext %6) #13, !dbg !569
  %"'ipc95" = bitcast [2 x double]* %"'" to i8*, !dbg !570
  %_replacementA98 = phi i8* , !dbg !570
  %"'ipc96" = bitcast [2 x double]* %"'ipa" to i8*, !dbg !570
  %_replacementA97 = phi i8* , !dbg !570
  store i8 1, i8* %_cache, align 1, !invariant.group !491
  br label %common.ret

allocsForInversion:                               ; No predecessors!
  %"iv'ac" = alloca i64, align 8
  %_cache = alloca i8, align 1
  %"'de" = alloca double, align 8
  %74 = getelementptr double, double* %"'de", i64 0
  store double 0.000000e+00, double* %74, align 8
  %"'de8" = alloca double, align 8
  %75 = getelementptr double, double* %"'de8", i64 0
  store double 0.000000e+00, double* %75, align 8
  %"'de24" = alloca double, align 8
  %76 = getelementptr double, double* %"'de24", i64 0
  store double 0.000000e+00, double* %76, align 8
  %"'de25" = alloca double, align 8
  %77 = getelementptr double, double* %"'de25", i64 0
  store double 0.000000e+00, double* %77, align 8
  %"'de26" = alloca double, align 8
  %78 = getelementptr double, double* %"'de26", i64 0
  store double 0.000000e+00, double* %78, align 8
  %"'de37" = alloca double, align 8
  %79 = getelementptr double, double* %"'de37", i64 0
  store double 0.000000e+00, double* %79, align 8
  %"'de38" = alloca double, align 8
  %80 = getelementptr double, double* %"'de38", i64 0
  store double 0.000000e+00, double* %80, align 8
  %"'de45" = alloca double, align 8
  %81 = getelementptr double, double* %"'de45", i64 0
  store double 0.000000e+00, double* %81, align 8
  %value_phi147_cache = alloca double*, align 8
  %"'de64" = alloca double, align 8
  %82 = getelementptr double, double* %"'de64", i64 0
  store double 0.000000e+00, double* %82, align 8
  %"'de65" = alloca double, align 8
  %83 = getelementptr double, double* %"'de65", i64 0
  store double 0.000000e+00, double* %83, align 8
  %"value_phi147'de" = alloca double, align 8
  %84 = getelementptr double, double* %"value_phi147'de", i64 0
  store double 0.000000e+00, double* %84, align 8
  %"'de68" = alloca double, align 8
  %85 = getelementptr double, double* %"'de68", i64 0
  store double 0.000000e+00, double* %85, align 8
  %"'de72" = alloca double, align 8
  %86 = getelementptr double, double* %"'de72", i64 0
  store double 0.000000e+00, double* %86, align 8
  %value_phi46_cache = alloca double*, align 8
  %"'de83" = alloca double, align 8
  %87 = getelementptr double, double* %"'de83", i64 0
  store double 0.000000e+00, double* %87, align 8
  %"'de84" = alloca double, align 8
  %88 = getelementptr double, double* %"'de84", i64 0
  store double 0.000000e+00, double* %88, align 8
  %"value_phi46'de" = alloca double, align 8
  %89 = getelementptr double, double* %"value_phi46'de", i64 0
  store double 0.000000e+00, double* %89, align 8
  %"value_phi1.lcssa'de" = alloca double, align 8
  %90 = getelementptr double, double* %"value_phi1.lcssa'de", i64 0
  store double 0.000000e+00, double* %90, align 8
  %"value_phi.lcssa'de" = alloca double, align 8
  %91 = getelementptr double, double* %"value_phi.lcssa'de", i64 0
  store double 0.000000e+00, double* %91, align 8

inverttop:                                        ; preds = %invertL14, %invertL11
  ret void

invertL7:                                         ; No predecessors!

invertcommon.ret:                                 ; preds = %common.ret
  %92 = load i8, i8* %_cache, align 1, !invariant.group !491
  switch i8 %92, label %invertL96 [
    i8 0, label %invertL11
    i8 1, label %invertL97
  ]

invertL11:                                        ; preds = %invertcommon.ret
  %".sroa.2.0..sroa_idx12'ipg_unwrap" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 1
  %93 = load double, double* %".sroa.2.0..sroa_idx12'ipg_unwrap", align 8, !alias.scope !571, !noalias !574
  store double 0.000000e+00, double* %".sroa.2.0..sroa_idx12'ipg_unwrap", align 8, !dbg !490, !alias.scope !571, !noalias !574
  %94 = load double, double* %"'de", align 8
  %95 = fadd fast double %94, %93
  store double %95, double* %"'de", align 8
  %".sroa.0.0..sroa_idx'ipg_unwrap" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 0
  %96 = load double, double* %".sroa.0.0..sroa_idx'ipg_unwrap", align 8, !alias.scope !571, !noalias !574
  store double 0.000000e+00, double* %".sroa.0.0..sroa_idx'ipg_unwrap", align 8, !dbg !490, !alias.scope !571, !noalias !574
  %97 = load double, double* %"'de", align 8
  %98 = fadd fast double %97, %96
  store double %98, double* %"'de", align 8
  %99 = load double, double* %"'de", align 8
  store double 0.000000e+00, double* %"'de", align 8
  %"'ipc_unwrap" = bitcast {} addrspace(10)* %"'1" to double addrspace(13)* addrspace(10)*
  %"'ipc3_unwrap" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc_unwrap" to double addrspace(13)* addrspace(11)*
  %"'il_phi_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc3_unwrap", align 16, !dbg !487, !tbaa !33, !alias.scope !489, !noalias !479, !nonnull !4
  %100 = atomicrmw fadd double addrspace(13)* %"'il_phi_unwrap", double %99 monotonic, align 8
  br label %inverttop

invertL14:                                        ; preds = %invertL16
  br label %inverttop

invertL16:                                        ; preds = %invertL96, %invertL60.preheader
  %101 = load double, double* %"'de8", align 8
  %_unwrap = bitcast {} addrspace(10)* %1 to double addrspace(13)* addrspace(10)*
  %_unwrap9 = addrspacecast double addrspace(13)* addrspace(10)* %_unwrap to double addrspace(13)* addrspace(11)*
  %_unwrap10 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %_unwrap9, align 16, !dbg !494, !tbaa !33, !alias.scope !497, !noalias !482, !nonnull !4, !invariant.group !498
  %_unwrap11 = getelementptr inbounds double, double addrspace(13)* %_unwrap10, i64 1
  %_unwrap12 = load double, double addrspace(13)* %_unwrap11, align 8, !dbg !505, !tbaa !38, !alias.scope !499, !noalias !502, !invariant.group !507
  %_unwrap13 = bitcast double %_unwrap12 to i64
  %.lobit20_unwrap = lshr i64 %_unwrap13, 63
  %_unwrap14 = trunc i64 %.lobit20_unwrap to i8
  %_unwrap15 = xor i8 %_unwrap14, -1
  %_unwrap16 = load double, double addrspace(13)* %_unwrap10, align 8, !dbg !494, !tbaa !38, !alias.scope !499, !noalias !502, !invariant.group !504
  %_unwrap17 = bitcast double %_unwrap16 to i64
  %.lobit_unwrap = lshr i64 %_unwrap17, 63
  %_unwrap18 = trunc i64 %.lobit_unwrap to i8
  %_unwrap19 = and i8 %_unwrap15, %_unwrap18
  %_unwrap20 = fcmp olt double %_unwrap16, %_unwrap12
  %_unwrap21 = zext i1 %_unwrap20 to i8
  %_unwrap22 = or i8 %_unwrap19, %_unwrap21
  %.not22_unwrap = icmp eq i8 %_unwrap22, 0
  %diffe = select fast i1 %.not22_unwrap, double %101, double 0.000000e+00
  %102 = load double, double* %"'de8", align 8
  %diffe23 = select fast i1 %.not22_unwrap, double 0.000000e+00, double %102
  store double 0.000000e+00, double* %"'de8", align 8
  %103 = load double, double* %"'de24", align 8
  %104 = fadd fast double %103, %101
  %105 = select fast i1 %.not22_unwrap, double %104, double %103
  store double %105, double* %"'de24", align 8
  %106 = load double, double* %"'de25", align 8
  %107 = fadd fast double %106, %102
  %108 = select fast i1 %.not22_unwrap, double %106, double %107
  store double %108, double* %"'de25", align 8
  %109 = load double, double* %"'de26", align 8
  %_unwrap27 = xor i8 %_unwrap18, -1
  %_unwrap28 = and i8 %_unwrap14, %_unwrap27
  %_unwrap29 = fcmp olt double %_unwrap12, %_unwrap16
  %_unwrap30 = zext i1 %_unwrap29 to i8
  %_unwrap31 = or i8 %_unwrap28, %_unwrap30
  %.not21_unwrap = icmp eq i8 %_unwrap31, 0
  %diffe32 = select fast i1 %.not21_unwrap, double %109, double 0.000000e+00
  %110 = load double, double* %"'de26", align 8
  %diffe33 = select fast i1 %.not21_unwrap, double 0.000000e+00, double %110
  store double 0.000000e+00, double* %"'de26", align 8
  %111 = load double, double* %"'de24", align 8
  %112 = fadd fast double %111, %109
  %113 = select fast i1 %.not21_unwrap, double %112, double %111
  store double %113, double* %"'de24", align 8
  %114 = load double, double* %"'de25", align 8
  %115 = fadd fast double %114, %110
  %116 = select fast i1 %.not21_unwrap, double %114, double %115
  store double %116, double* %"'de25", align 8
  %117 = load double, double* %"'de24", align 8
  %_unwrap34 = fcmp ord double %_unwrap12, 0.000000e+00
  %diffe35 = select fast i1 %_unwrap34, double %117, double 0.000000e+00
  %118 = load double, double* %"'de24", align 8
  %diffe36 = select fast i1 %_unwrap34, double 0.000000e+00, double %118
  store double 0.000000e+00, double* %"'de24", align 8
  %119 = load double, double* %"'de37", align 8
  %120 = fadd fast double %119, %117
  %121 = select fast i1 %_unwrap34, double %120, double %119
  store double %121, double* %"'de37", align 8
  %122 = load double, double* %"'de38", align 8
  %123 = fadd fast double %122, %118
  %124 = select fast i1 %_unwrap34, double %122, double %123
  store double %124, double* %"'de38", align 8
  %125 = load double, double* %"'de25", align 8
  %_unwrap39 = fcmp ord double %_unwrap16, 0.000000e+00
  %diffe40 = select fast i1 %_unwrap39, double %125, double 0.000000e+00
  %126 = load double, double* %"'de25", align 8
  %diffe41 = select fast i1 %_unwrap39, double 0.000000e+00, double %126
  store double 0.000000e+00, double* %"'de25", align 8
  %127 = load double, double* %"'de38", align 8
  %128 = fadd fast double %127, %125
  %129 = select fast i1 %_unwrap39, double %128, double %127
  store double %129, double* %"'de38", align 8
  %130 = load double, double* %"'de37", align 8
  %131 = fadd fast double %130, %126
  %132 = select fast i1 %_unwrap39, double %130, double %131
  store double %132, double* %"'de37", align 8
  %133 = load double, double* %"'de38", align 8
  store double 0.000000e+00, double* %"'de38", align 8
  %"'ipc42_unwrap" = bitcast {} addrspace(10)* %"'1" to double addrspace(13)* addrspace(10)*
  %"'ipc43_unwrap" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc42_unwrap" to double addrspace(13)* addrspace(11)*
  %"'il_phi2_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc43_unwrap", align 16, !dbg !494, !tbaa !33, !alias.scope !489, !noalias !479, !nonnull !4
  %"'ipg_unwrap" = getelementptr inbounds double, double addrspace(13)* %"'il_phi2_unwrap", i64 1
  %134 = atomicrmw fadd double addrspace(13)* %"'ipg_unwrap", double %133 monotonic, align 8
  %135 = load double, double* %"'de37", align 8
  store double 0.000000e+00, double* %"'de37", align 8
  %136 = atomicrmw fadd double addrspace(13)* %"'il_phi2_unwrap", double %135 monotonic, align 8
  br label %invertL14

invertL60.preheader:                              ; preds = %invertL60
  %137 = load i64, i64* %"iv'ac", align 8
  %forfree = load double*, double** %value_phi147_cache, align 8, !dereferenceable !539, !invariant.group !533
  %138 = bitcast double* %forfree to i8*
  call void @free(i8* nonnull %138), !dbg !486, !enzyme_cache_free !531
  %139 = load i64, i64* %"iv'ac", align 8
  %forfree73 = load double*, double** %value_phi46_cache, align 8, !dereferenceable !539, !invariant.group !536
  %140 = bitcast double* %forfree73 to i8*
  call void @free(i8* nonnull %140), !dbg !486, !enzyme_cache_free !534
  br label %invertL16

invertL60:                                        ; preds = %mergeinvertL60_L96.loopexit, %incinvertL60
  %141 = load double, double* %"'de45", align 8
  %142 = load i64, i64* %"iv'ac", align 8
  %_unwrap46 = bitcast {} addrspace(10)* %1 to double addrspace(13)* addrspace(10)*
  %_unwrap47 = addrspacecast double addrspace(13)* addrspace(10)* %_unwrap46 to double addrspace(13)* addrspace(11)*
  %_unwrap48 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %_unwrap47, align 16, !dbg !494, !tbaa !33, !alias.scope !497, !noalias !482, !nonnull !4, !invariant.group !498
  %_unwrap49 = add i64 %142, 2
  %_unwrap50 = getelementptr inbounds double, double addrspace(13)* %_unwrap48, i64 %_unwrap49
  %_unwrap51 = load double, double addrspace(13)* %_unwrap50, align 8, !dbg !542, !tbaa !38, !alias.scope !499, !noalias !502, !invariant.group !543
  %_unwrap52 = bitcast double %_unwrap51 to i64
  %.lobit25_unwrap = lshr i64 %_unwrap52, 63
  %_unwrap53 = trunc i64 %.lobit25_unwrap to i8
  %_unwrap54 = xor i8 %_unwrap53, -1
  %_unwrap55 = add nsw i64 %6, -3
  %143 = add nuw i64 %_unwrap55, 1
  %144 = load double*, double** %value_phi147_cache, align 8, !dereferenceable !539, !invariant.group !533
  %145 = getelementptr inbounds double, double* %144, i64 %142
  %146 = load double, double* %145, align 8, !invariant.group !540
  %_unwrap56 = bitcast double %146 to i64
  %.lobit27_unwrap = lshr i64 %_unwrap56, 63
  %_unwrap57 = trunc i64 %.lobit27_unwrap to i8
  %_unwrap58 = and i8 %_unwrap54, %_unwrap57
  %_unwrap59 = fcmp olt double %146, %_unwrap51
  %_unwrap60 = zext i1 %_unwrap59 to i8
  %_unwrap61 = or i8 %_unwrap58, %_unwrap60
  %.not28_unwrap = icmp eq i8 %_unwrap61, 0
  %diffe62 = select fast i1 %.not28_unwrap, double %141, double 0.000000e+00
  %147 = load double, double* %"'de45", align 8
  %diffe63 = select fast i1 %.not28_unwrap, double 0.000000e+00, double %147
  store double 0.000000e+00, double* %"'de45", align 8
  %148 = load double, double* %"'de64", align 8
  %149 = fadd fast double %148, %141
  %150 = select fast i1 %.not28_unwrap, double %149, double %148
  store double %150, double* %"'de64", align 8
  %151 = load double, double* %"'de65", align 8
  %152 = fadd fast double %151, %147
  %153 = select fast i1 %.not28_unwrap, double %151, double %152
  store double %153, double* %"'de65", align 8
  %154 = load double, double* %"'de64", align 8
  %155 = load i64, i64* %"iv'ac", align 8
  %_unwrap66 = fcmp ord double %_unwrap51, 0.000000e+00
  %diffevalue_phi147 = select fast i1 %_unwrap66, double %154, double 0.000000e+00
  %156 = load double, double* %"'de64", align 8
  %diffe67 = select fast i1 %_unwrap66, double 0.000000e+00, double %156
  store double 0.000000e+00, double* %"'de64", align 8
  %157 = load double, double* %"value_phi147'de", align 8
  %158 = fadd fast double %157, %154
  %159 = select fast i1 %_unwrap66, double %158, double %157
  store double %159, double* %"value_phi147'de", align 8
  %160 = load double, double* %"'de68", align 8
  %161 = fadd fast double %160, %156
  %162 = select fast i1 %_unwrap66, double %160, double %161
  store double %162, double* %"'de68", align 8
  %163 = load double, double* %"'de65", align 8
  %164 = load i64, i64* %"iv'ac", align 8
  %_unwrap69 = fcmp ord double %146, 0.000000e+00
  %diffe70 = select fast i1 %_unwrap69, double %163, double 0.000000e+00
  %165 = load double, double* %"'de65", align 8
  %diffevalue_phi14771 = select fast i1 %_unwrap69, double 0.000000e+00, double %165
  store double 0.000000e+00, double* %"'de65", align 8
  %166 = load double, double* %"'de68", align 8
  %167 = fadd fast double %166, %163
  %168 = select fast i1 %_unwrap69, double %167, double %166
  store double %168, double* %"'de68", align 8
  %169 = load double, double* %"value_phi147'de", align 8
  %170 = fadd fast double %169, %165
  %171 = select fast i1 %_unwrap69, double %169, double %170
  store double %171, double* %"value_phi147'de", align 8
  %172 = load double, double* %"'de72", align 8
  %173 = load i64, i64* %"iv'ac", align 8
  %174 = add nuw i64 %_unwrap55, 1
  %175 = load double*, double** %value_phi46_cache, align 8, !dereferenceable !539, !invariant.group !536
  %176 = getelementptr inbounds double, double* %175, i64 %173
  %177 = load double, double* %176, align 8, !invariant.group !541
  %_unwrap74 = bitcast double %177 to i64
  %.lobit24_unwrap = lshr i64 %_unwrap74, 63
  %_unwrap75 = trunc i64 %.lobit24_unwrap to i8
  %_unwrap76 = xor i8 %_unwrap75, -1
  %_unwrap77 = and i8 %_unwrap53, %_unwrap76
  %_unwrap78 = fcmp olt double %_unwrap51, %177
  %_unwrap79 = zext i1 %_unwrap78 to i8
  %_unwrap80 = or i8 %_unwrap77, %_unwrap79
  %.not26_unwrap = icmp eq i8 %_unwrap80, 0
  %diffe81 = select fast i1 %.not26_unwrap, double %172, double 0.000000e+00
  %178 = load double, double* %"'de72", align 8
  %diffe82 = select fast i1 %.not26_unwrap, double 0.000000e+00, double %178
  store double 0.000000e+00, double* %"'de72", align 8
  %179 = load double, double* %"'de83", align 8
  %180 = fadd fast double %179, %172
  %181 = select fast i1 %.not26_unwrap, double %180, double %179
  store double %181, double* %"'de83", align 8
  %182 = load double, double* %"'de84", align 8
  %183 = fadd fast double %182, %178
  %184 = select fast i1 %.not26_unwrap, double %182, double %183
  store double %184, double* %"'de84", align 8
  %185 = load double, double* %"'de83", align 8
  %diffevalue_phi46 = select fast i1 %_unwrap66, double %185, double 0.000000e+00
  %186 = load double, double* %"'de83", align 8
  %diffe85 = select fast i1 %_unwrap66, double 0.000000e+00, double %186
  store double 0.000000e+00, double* %"'de83", align 8
  %187 = load double, double* %"value_phi46'de", align 8
  %188 = fadd fast double %187, %185
  %189 = select fast i1 %_unwrap66, double %188, double %187
  store double %189, double* %"value_phi46'de", align 8
  %190 = load double, double* %"'de68", align 8
  %191 = fadd fast double %190, %186
  %192 = select fast i1 %_unwrap66, double %190, double %191
  store double %192, double* %"'de68", align 8
  %193 = load double, double* %"'de84", align 8
  %194 = load i64, i64* %"iv'ac", align 8
  %_unwrap86 = fcmp ord double %177, 0.000000e+00
  %diffe87 = select fast i1 %_unwrap86, double %193, double 0.000000e+00
  %195 = load double, double* %"'de84", align 8
  %diffevalue_phi4688 = select fast i1 %_unwrap86, double 0.000000e+00, double %195
  store double 0.000000e+00, double* %"'de84", align 8
  %196 = load double, double* %"'de68", align 8
  %197 = fadd fast double %196, %193
  %198 = select fast i1 %_unwrap86, double %197, double %196
  store double %198, double* %"'de68", align 8
  %199 = load double, double* %"value_phi46'de", align 8
  %200 = fadd fast double %199, %195
  %201 = select fast i1 %_unwrap86, double %199, double %200
  store double %201, double* %"value_phi46'de", align 8
  %202 = load double, double* %"'de68", align 8
  store double 0.000000e+00, double* %"'de68", align 8
  %203 = load i64, i64* %"iv'ac", align 8
  %"'ipc42_unwrap90" = bitcast {} addrspace(10)* %"'1" to double addrspace(13)* addrspace(10)*
  %"'ipc43_unwrap91" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc42_unwrap90" to double addrspace(13)* addrspace(11)*
  %"'ipl44_unwrap" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc43_unwrap91", align 16, !dbg !494, !tbaa !33, !alias.scope !489, !noalias !479, !nonnull !4, !invariant.group !496
  %"'ipg89_unwrap" = getelementptr inbounds double, double addrspace(13)* %"'ipl44_unwrap", i64 %_unwrap49
  %204 = atomicrmw fadd double addrspace(13)* %"'ipg89_unwrap", double %202 monotonic, align 8
  %205 = load double, double* %"value_phi147'de", align 8
  store double 0.000000e+00, double* %"value_phi147'de", align 8
  %206 = load i64, i64* %"iv'ac", align 8
  %207 = icmp eq i64 %206, 0
  %208 = xor i1 %207, true
  %209 = select fast i1 %207, double %205, double 0.000000e+00
  %210 = load double, double* %"'de8", align 8
  %211 = fadd fast double %210, %205
  %212 = select fast i1 %207, double %211, double %210
  store double %212, double* %"'de8", align 8
  %213 = select fast i1 %208, double %205, double 0.000000e+00
  %214 = load double, double* %"'de45", align 8
  %215 = fadd fast double %214, %205
  %216 = select fast i1 %207, double %214, double %215
  store double %216, double* %"'de45", align 8
  %217 = load double, double* %"value_phi46'de", align 8
  store double 0.000000e+00, double* %"value_phi46'de", align 8
  %218 = select fast i1 %207, double %217, double 0.000000e+00
  %219 = load double, double* %"'de26", align 8
  %220 = fadd fast double %219, %217
  %221 = select fast i1 %207, double %220, double %219
  store double %221, double* %"'de26", align 8
  %222 = select fast i1 %208, double %217, double 0.000000e+00
  %223 = load double, double* %"'de72", align 8
  %224 = fadd fast double %223, %217
  %225 = select fast i1 %207, double %223, double %224
  store double %225, double* %"'de72", align 8
  br i1 %207, label %invertL60.preheader, label %incinvertL60

incinvertL60:                                     ; preds = %invertL60
  %226 = load i64, i64* %"iv'ac", align 8
  %227 = add nsw i64 %226, -1
  store i64 %227, i64* %"iv'ac", align 8
  br label %invertL60

invertL96.loopexit:                               ; preds = %invertL96
  %_unwrap93 = add nsw i64 %6, -3
  br label %mergeinvertL60_L96.loopexit

mergeinvertL60_L96.loopexit:                      ; preds = %invertL96.loopexit
  store i64 %_unwrap93, i64* %"iv'ac", align 8
  br label %invertL60

invertL96:                                        ; preds = %invertcommon.ret
  %".sroa.241.0..sroa_idx42'ipg_unwrap" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 1
  %228 = load double, double* %".sroa.241.0..sroa_idx42'ipg_unwrap", align 8, !alias.scope !571, !noalias !574
  store double 0.000000e+00, double* %".sroa.241.0..sroa_idx42'ipg_unwrap", align 8, !dbg !568, !alias.scope !571, !noalias !574
  %229 = load double, double* %"value_phi1.lcssa'de", align 8
  %230 = fadd fast double %229, %228
  store double %230, double* %"value_phi1.lcssa'de", align 8
  %".sroa.040.0..sroa_idx'ipg_unwrap" = getelementptr inbounds [2 x double], [2 x double]* %"'", i64 0, i64 0
  %231 = load double, double* %".sroa.040.0..sroa_idx'ipg_unwrap", align 8, !alias.scope !571, !noalias !574
  store double 0.000000e+00, double* %".sroa.040.0..sroa_idx'ipg_unwrap", align 8, !dbg !568, !alias.scope !571, !noalias !574
  %232 = load double, double* %"value_phi.lcssa'de", align 8
  %233 = fadd fast double %232, %231
  store double %233, double* %"value_phi.lcssa'de", align 8
  %234 = load double, double* %"value_phi.lcssa'de", align 8
  store double 0.000000e+00, double* %"value_phi.lcssa'de", align 8
  %.not2345_unwrap = icmp ugt i64 %6, 2
  %235 = xor i1 %.not2345_unwrap, true
  %236 = select fast i1 %.not2345_unwrap, double %234, double 0.000000e+00
  %237 = load double, double* %"'de72", align 8
  %238 = fadd fast double %237, %234
  %239 = select fast i1 %.not2345_unwrap, double %238, double %237
  store double %239, double* %"'de72", align 8
  %240 = select fast i1 %235, double %234, double 0.000000e+00
  %241 = load double, double* %"'de26", align 8
  %242 = fadd fast double %241, %234
  %243 = select fast i1 %.not2345_unwrap, double %241, double %242
  store double %243, double* %"'de26", align 8
  %244 = load double, double* %"value_phi1.lcssa'de", align 8
  store double 0.000000e+00, double* %"value_phi1.lcssa'de", align 8
  %245 = select fast i1 %.not2345_unwrap, double %244, double 0.000000e+00
  %246 = load double, double* %"'de45", align 8
  %247 = fadd fast double %246, %244
  %248 = select fast i1 %.not2345_unwrap, double %247, double %246
  store double %248, double* %"'de45", align 8
  %249 = select fast i1 %235, double %244, double 0.000000e+00
  %250 = load double, double* %"'de8", align 8
  %251 = fadd fast double %250, %244
  %252 = select fast i1 %.not2345_unwrap, double %250, double %251
  store double %252, double* %"'de8", align 8
  br i1 %.not2345_unwrap, label %invertL96.loopexit, label %invertL16

invertL97:                                        ; preds = %invertcommon.ret
  %"'ipc95_unwrap" = bitcast [2 x double]* %"'" to i8*, !dbg !570
  %"'ipc96_unwrap" = bitcast [2 x double]* %"'ipa" to i8*, !dbg !570
  %253 = bitcast i8* %"'ipc95_unwrap" to double*, !dbg !570
  %254 = bitcast i8* %"'ipc96_unwrap" to double*, !dbg !570
  call void @__enzyme_memcpyadd_doubleda8sa8(double* %253, double* %254, i64 2), !dbg !570
}

<begin dump>
key=  %70 = bitcast [2 x double]* %2 to i8*, !dbg !123 val=  %_replacementA97 = phi i8* , !dbg !149
key=  %34 = fcmp olt double %17, %19, !dbg !81 val=  %29 = fcmp olt double %12, %14, !dbg !97
key=  %46 = bitcast double %value_phi46 to i64, !dbg !100 val=  %51 = bitcast double %value_phi46 to i64, !dbg !126
key=  %66 = select i1 %65, double %43, double %value_phi147, !dbg !119 val=  %71 = select i1 %70, double %48, double %value_phi147, !dbg !145
key=  %.not2345 = icmp ugt i64 %7, 2, !dbg !90 val=  %.not2345 = icmp ugt i64 %6, 2, !dbg !106
key=  %13 = icmp ugt i64 %7, 15, !dbg !42 val=  %8 = icmp ugt i64 %6, 15, !dbg !45
key=  %65 = fcmp ord double %value_phi147, 0.000000e+00, !dbg !117 val=  %70 = fcmp ord double %value_phi147, 0.000000e+00, !dbg !143
key=  %51 = zext i1 %44 to i8, !dbg !105 val=  %56 = zext i1 %49 to i8, !dbg !131
key=  %55 = fcmp ord double %43, 0.000000e+00, !dbg !106 val=  %60 = fcmp ord double %48, 0.000000e+00, !dbg !132
key=  %3 = call {}*** @julia.get_pgcstack() #12 val=  %2 = call {}*** @julia.get_pgcstack() #12
key=  br i1 %13, label %L97, label %L16, !dbg !45 val=  br i1 %8, label %L97, label %L16, !dbg !48
key=  br label %L60, !dbg !91 val=  br label %L60, !dbg !107
key=  %44 = fcmp olt double %43, %value_phi46, !dbg !96 val=  %49 = fcmp olt double %48, %value_phi46, !dbg !122
key=  %4 = bitcast {} addrspace(10)* %1 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !12 val=  %3 = bitcast {} addrspace(10)* %1 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !12
key=  switch i64 %7, label %L14 [
    i64 0, label %L7
    i64 1, label %L11
  ], !dbg !27 val=  switch i64 %6, label %L14 [
    i64 0, label %L7
    i64 1, label %L11
  ], !dbg !32
key=  %35 = xor i8 %25, -1, !dbg !85 val=  %30 = xor i8 %20, -1, !dbg !101
key=  %37 = zext i1 %34 to i8, !dbg !88 val=  %32 = zext i1 %29 to i8, !dbg !104
key=  %17 = load double, double addrspace(13)* %16, align 8, !dbg !46, !tbaa !38 val=  %12 = load double, double addrspace(13)* %11, align 8, !dbg !49, !tbaa !54, !alias.scope !57, !noalias !60, !invariant.group !62
key=  %26 = and i8 %25, %24, !dbg !70 val=  %21 = and i8 %20, %19, !dbg !86
key=  %value_phi46 = phi double [ %57, %L60 ], [ %33, %L60.preheader ] val=  %value_phi46 = phi double [ %62, %L60 ], [ %28, %L60.preheader ]
key=  %value_phi147 = phi double [ %68, %L60 ], [ %39, %L60.preheader ] val=  %value_phi147 = phi double [ %73, %L60 ], [ %34, %L60.preheader ]
key=  %31 = fcmp ord double %19, 0.000000e+00, !dbg !74 val=  %26 = fcmp ord double %14, 0.000000e+00, !dbg !90
key=  br label %L96, !dbg !120 val=  br label %L96, !dbg !146
key=  %67 = select i1 %55, double %value_phi147, double %43, !dbg !119 val=  %72 = select i1 %60, double %value_phi147, double %48, !dbg !145
key=  %.not26 = icmp eq i8 %52, 0, !dbg !105 val=  %.not26 = icmp eq i8 %57, 0, !dbg !131
key=  %19 = load double, double addrspace(13)* %18, align 8, !dbg !48, !tbaa !38 val=  %14 = load double, double addrspace(13)* %13, align 8, !dbg !63, !tbaa !54, !alias.scope !57, !noalias !60, !invariant.group !65
key=  %5 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %4 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !12 val=  %4 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %3 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !12
key=  %49 = trunc i64 %.lobit25 to i8, !dbg !104 val=  %54 = trunc i64 %.lobit25 to i8, !dbg !130
key=  %20 = fcmp olt double %19, %17, !dbg !50 val=  %15 = fcmp olt double %14, %12, !dbg !66
key=  %59 = bitcast double %value_phi147 to i64, !dbg !112 val=  %64 = bitcast double %value_phi147 to i64, !dbg !138
key=  %62 = and i8 %60, %61, !dbg !115 val=  %67 = and i8 %65, %66, !dbg !141
key=  %61 = trunc i64 %.lobit27 to i8, !dbg !115 val=  %66 = trunc i64 %.lobit27 to i8, !dbg !141
key=  %16 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %15, align 16, !dbg !46, !tbaa !33, !alias.scope !35, !nonnull !4 val=  %11 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %10, align 16, !dbg !49, !tbaa !38, !alias.scope !52, !noalias !30, !nonnull !4, !invariant.group !53
key=  %25 = trunc i64 %.lobit20 to i8, !dbg !70 val=  %20 = trunc i64 %.lobit20 to i8, !dbg !86
key=  %57 = select i1 %.not26, double %56, double %54, !dbg !108 val=  %62 = select i1 %.not26, double %61, double %59, !dbg !134
key=  %38 = or i8 %36, %37, !dbg !88 val=  %33 = or i8 %31, %32, !dbg !104
key=  %18 = getelementptr inbounds double, double addrspace(13)* %16, i64 1, !dbg !48 val=  %13 = getelementptr inbounds double, double addrspace(13)* %11, i64 1, !dbg !63
key=  %28 = or i8 %26, %27, !dbg !72 val=  %23 = or i8 %21, %22, !dbg !88
key=  %.sroa.040.0..sroa_idx = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0, !dbg !120 val=  %.sroa.040.0..sroa_idx_replacementA = phi double* , !dbg !146
key=  %36 = and i8 %35, %23, !dbg !87 val=  %31 = and i8 %30, %18, !dbg !103
key=  br label %common.ret val=  br label %common.ret
key=  %11 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %10, align 16, !dbg !30, !tbaa !33, !alias.scope !35, !nonnull !4 val=  %_replacementA5 = phi double addrspace(13)* , !dbg !35
key=  %47 = trunc i64 %.lobit24 to i8, !dbg !101 val=  %52 = trunc i64 %.lobit24 to i8, !dbg !127
key=  %22 = bitcast double %17 to i64, !dbg !59 val=  %17 = bitcast double %12 to i64, !dbg !75
key=  %.sroa.2.0..sroa_idx12 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 1, !dbg !41 val=  %.sroa.2.0..sroa_idx12_replacementA = phi double* , !dbg !43
key=  %24 = xor i8 %23, -1, !dbg !62 val=  %19 = xor i8 %18, -1, !dbg !78
key=  %32 = select i1 %31, double %17, double %19, !dbg !78 val=  %27 = select i1 %26, double %12, double %14, !dbg !94
key=  %48 = xor i8 %47, -1, !dbg !101 val=  %53 = xor i8 %52, -1, !dbg !127
key=  %29 = fcmp ord double %17, 0.000000e+00, !dbg !74 val=  %24 = fcmp ord double %12, 0.000000e+00, !dbg !90
key=  %value_phi.lcssa = phi double [ %33, %L16 ], [ %57, %L96.loopexit ] val=  %value_phi.lcssa_replacementA = phi double
key=  %10 = addrspacecast double addrspace(13)* addrspace(10)* %9 to double addrspace(13)* addrspace(11)*, !dbg !30 val=  %_replacementA6 = phi double addrspace(13)* addrspace(11)* , !dbg !35
key=  %43 = load double, double addrspace(13)* %42, align 8, !dbg !95, !tbaa !38 val=  %48 = load double, double addrspace(13)* %47, align 8, !dbg !120, !tbaa !54, !alias.scope !57, !noalias !60, !invariant.group !121
key=  %.lobit20 = lshr i64 %21, 63, !dbg !70 val=  %.lobit20 = lshr i64 %16, 63, !dbg !86
key=  %9 = bitcast {} addrspace(10)* %1 to double addrspace(13)* addrspace(10)*, !dbg !30 val=  %_replacementA7 = phi double addrspace(13)* addrspace(10)* , !dbg !35
key=  %54 = select i1 %53, double %43, double %value_phi46, !dbg !108 val=  %59 = select i1 %58, double %48, double %value_phi46, !dbg !134
key=  br label %common.ret val=  br label %common.ret
key=  %30 = select i1 %29, double %19, double %17, !dbg !78 val=  %25 = select i1 %24, double %14, double %12, !dbg !94
key=  %64 = or i8 %62, %63, !dbg !116 val=  %69 = or i8 %67, %68, !dbg !142
key=  %15 = addrspacecast double addrspace(13)* addrspace(10)* %14 to double addrspace(13)* addrspace(11)*, !dbg !46 val=  %10 = addrspacecast double addrspace(13)* addrspace(10)* %9 to double addrspace(13)* addrspace(11)*, !dbg !49
key=  %21 = bitcast double %19 to i64, !dbg !59 val=  %16 = bitcast double %14 to i64, !dbg !75
key=  %.not21 = icmp eq i8 %28, 0, !dbg !72 val=  %.not21 = icmp eq i8 %23, 0, !dbg !88
key=  br i1 %exitcond.not, label %L96.loopexit, label %L60, !dbg !91 val=  br i1 %exitcond.not, label %L96.loopexit, label %L60, !dbg !107
key=  %63 = zext i1 %58 to i8, !dbg !116 val=  %68 = zext i1 %63 to i8, !dbg !142
key=  %.not22 = icmp eq i8 %38, 0, !dbg !88 val=  %.not22 = icmp eq i8 %33, 0, !dbg !104
key=  %45 = bitcast double %43 to i64, !dbg !100 val=  %50 = bitcast double %48 to i64, !dbg !126
key=  %53 = fcmp ord double %value_phi46, 0.000000e+00, !dbg !106 val=  %58 = fcmp ord double %value_phi46, 0.000000e+00, !dbg !132
key=  %.lobit25 = lshr i64 %45, 63, !dbg !104 val=  %.lobit25 = lshr i64 %50, 63, !dbg !130
key=  %6 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %5, i64 0, i32 1, !dbg !12 val=  %5 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %4, i64 0, i32 1, !dbg !12
key=  %.lobit = lshr i64 %22, 63, !dbg !62 val=  %.lobit = lshr i64 %17, 63, !dbg !78
key=  %23 = trunc i64 %.lobit to i8, !dbg !62 val=  %18 = trunc i64 %.lobit to i8, !dbg !78
key=  %50 = and i8 %49, %48, !dbg !104 val=  %55 = and i8 %54, %53, !dbg !130
key=  %iv.next = add nuw nsw i64 %iv, 1, !dbg !92 val=  %iv.next = add nuw nsw i64 %iv, 1, !dbg !114
key=  %33 = select i1 %.not21, double %32, double %30, !dbg !78 val=  %28 = select i1 %.not21, double %27, double %25, !dbg !94
key=  %40 = add i64 %iv, 2, !dbg !92 val=  %45 = add i64 %iv, 2, !dbg !114
key=  %12 = load double, double addrspace(13)* %11, align 8, !dbg !30, !tbaa !38 val=  %_replacementA4 = phi double , !dbg !35
key=  %.lobit24 = lshr i64 %46, 63, !dbg !101 val=  %.lobit24 = lshr i64 %51, 63, !dbg !127
key=  %iv = phi i64 [ 0, %L60.preheader ], [ %iv.next, %L60 ] val=  %iv = phi i64 [ 0, %L60.preheader ], [ %iv.next, %L60 ]
key=  %.lobit27 = lshr i64 %59, 63, !dbg !115 val=  %.lobit27 = lshr i64 %64, 63, !dbg !141
key=  %58 = fcmp olt double %value_phi147, %43, !dbg !109 val=  %63 = fcmp olt double %value_phi147, %48, !dbg !135
key=  %39 = select i1 %.not22, double %32, double %30, !dbg !89 val=  %34 = select i1 %.not22, double %27, double %25, !dbg !105
key=  %42 = getelementptr inbounds double, double addrspace(13)* %16, i64 %40, !dbg !95 val=  %47 = getelementptr inbounds double, double addrspace(13)* %11, i64 %45, !dbg !120
key=  %52 = or i8 %50, %51, !dbg !105 val=  %57 = or i8 %55, %56, !dbg !131
key=  %7 = load i64, i64 addrspace(11)* %6, align 8, !dbg !12, !tbaa !21, !range !26 val=  %6 = load i64, i64 addrspace(11)* %5, align 8, !dbg !12, !tbaa !21, !range !26, !alias.scope !27, !noalias !30
key=  unreachable, !dbg !28 val=Assertion failed: V && "Dereferencing deleted ValueHandle", file /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR/ValueHandle.h, line 94

signal (22): SIGABRT
in expression starting at REPL[3]:1
crt_sig_handler at C:/workdir/src\signals-win.c:93
raise at C:\WINDOWS\System32\msvcrt.dll (unknown line)
abort at C:\WINDOWS\System32\msvcrt.dll (unknown line)
assert at C:\WINDOWS\System32\msvcrt.dll (unknown line)
operator* at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\ValueHandle.h:94 [inlined]
dumpMap<const llvm::Value*, llvm::WeakTrackingVH> at /workspace/srcdir/Enzyme/enzyme/Enzyme/TypeAnalysis/..\Utils.h:221 [inlined]
getNewFromOriginal at /workspace/srcdir/Enzyme/enzyme/Enzyme\GradientUtils.cpp:546
getNewFromOriginal at /workspace/srcdir/Enzyme/enzyme/Enzyme\GradientUtils.cpp:573
operator() at /workspace/srcdir/Enzyme/enzyme/Enzyme\EnzymeLogic.cpp:1500
operator() at /workspace/srcdir/Enzyme/enzyme/Enzyme\EnzymeLogic.cpp:1532 [inlined]
_M_invoke at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/8.1.0/bits\std_function.h:282
operator() at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/8.1.0/bits\std_function.h:687 [inlined]
allFollowersOf at /workspace/srcdir/Enzyme/enzyme/Enzyme/TypeAnalysis/..\Utils.h:693
legalCombinedForwardReverse at /workspace/srcdir/Enzyme/enzyme/Enzyme\EnzymeLogic.cpp:1539
recursivelyHandleSubfunction at /workspace/srcdir/Enzyme/enzyme/Enzyme\AdjointGenerator.h:8506
visitCallInst at /workspace/srcdir/Enzyme/enzyme/Enzyme\AdjointGenerator.h:12417
delegateCallInst at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\InstVisitor.h:302 [inlined]
visitCall at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\Instruction.def:209 [inlined]
visit at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\Instruction.def:209
visit at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\InstVisitor.h:112 [inlined]
CreatePrimalAndGradient at /workspace/srcdir/Enzyme/enzyme/Enzyme\EnzymeLogic.cpp:4188
recursivelyHandleSubfunction at /workspace/srcdir/Enzyme/enzyme/Enzyme\AdjointGenerator.h:9164
visitCallInst at /workspace/srcdir/Enzyme/enzyme/Enzyme\AdjointGenerator.h:12417
delegateCallInst at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\InstVisitor.h:302 [inlined]
visitCall at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\Instruction.def:209 [inlined]
visit at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\Instruction.def:209
visit at /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/usr/local/include/llvm/IR\InstVisitor.h:112 [inlined]
CreatePrimalAndGradient at /workspace/srcdir/Enzyme/enzyme/Enzyme\EnzymeLogic.cpp:4188
EnzymeCreatePrimalAndGradient at /workspace/srcdir/Enzyme/enzyme/Enzyme\CApi.cpp:567
EnzymeCreatePrimalAndGradient at C:\Users\Joe\.julia\dev\Enzyme\src\api.jl:128
enzyme! at C:\Users\Joe\.julia\dev\Enzyme\src\compiler.jl:7690
unknown function (ip: 0000015eae536b81)
#codegen#193 at C:\Users\Joe\.julia\dev\Enzyme\src\compiler.jl:9046
codegen##kw at C:\Users\Joe\.julia\dev\Enzyme\src\compiler.jl:8654 [inlined]
_thunk at C:\Users\Joe\.julia\dev\Enzyme\src\compiler.jl:9558
_thunk at C:\Users\Joe\.julia\dev\Enzyme\src\compiler.jl:9555 [inlined]
cached_compilation at C:\Users\Joe\.julia\dev\Enzyme\src\compiler.jl:9593 [inlined]
#s273#222 at C:\Users\Joe\.julia\dev\Enzyme\src\compiler.jl:9651 [inlined]
#s273#222 at .\none:0
GeneratedFunctionStub at .\boot.jl:582
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
jl_call_staged at C:/workdir/src\method.c:520
ijl_code_for_staged at C:/workdir/src\method.c:571
get_staged at .\compiler\utilities.jl:114
retrieve_code_info at .\compiler\utilities.jl:126 [inlined]
InferenceState at .\compiler\inferencestate.jl:284
typeinf_edge at .\compiler\typeinfer.jl:868
abstract_call_method at .\compiler\abstractinterpretation.jl:647
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:139
abstract_call_known at .\compiler\abstractinterpretation.jl:1716
abstract_call at .\compiler\abstractinterpretation.jl:1786
abstract_call at .\compiler\abstractinterpretation.jl:1753
abstract_eval_statement at .\compiler\abstractinterpretation.jl:1910
typeinf_local at .\compiler\abstractinterpretation.jl:2386
typeinf_nocycle at .\compiler\abstractinterpretation.jl:2482
_typeinf at .\compiler\typeinfer.jl:230
typeinf at .\compiler\typeinfer.jl:213
typeinf_edge at .\compiler\typeinfer.jl:877
abstract_call_method at .\compiler\abstractinterpretation.jl:647
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:139
abstract_call_known at .\compiler\abstractinterpretation.jl:1716
abstract_call at .\compiler\abstractinterpretation.jl:1786
abstract_call at .\compiler\abstractinterpretation.jl:1753
abstract_eval_statement at .\compiler\abstractinterpretation.jl:1910
typeinf_local at .\compiler\abstractinterpretation.jl:2360
typeinf_nocycle at .\compiler\abstractinterpretation.jl:2482
_typeinf at .\compiler\typeinfer.jl:230
typeinf at .\compiler\typeinfer.jl:213
typeinf_ext at .\compiler\typeinfer.jl:967
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1000
typeinf_ext_toplevel at .\compiler\typeinfer.jl:996
jfptr_typeinf_ext_toplevel_17721.clone_1 at C:\Users\Joe\Documents\soft\Julia\Julia-1.8.5\lib\julia\sys.dll (unknown line)
_jl_invoke at C:/workdir/src\gf.c:2377 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:2559 [inlined]
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
jl_type_infer at C:/workdir/src\gf.c:315
jl_generate_fptr_impl at C:/workdir/src\jitlayers.cpp:319
jl_compile_method_internal at C:/workdir/src\gf.c:2091
jl_compile_method_internal at C:/workdir/src\gf.c:2038 [inlined]
_jl_invoke at C:/workdir/src\gf.c:2369 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:2559
autodiff at C:\Users\Joe\.julia\dev\Enzyme\src\Enzyme.jl:214
unknown function (ip: 0000015eae4bd4ca)
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:215
eval_stmt_value at C:/workdir/src\interpreter.c:166 [inlined]
eval_body at C:/workdir/src\interpreter.c:612
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:750
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:906
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:850
ijl_toplevel_eval at C:/workdir/src\toplevel.c:915 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:965
eval at .\boot.jl:368 [inlined]
eval_user_input at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:151
repl_backend_loop at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:247
start_repl_backend at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:232
#run_repl#47 at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:369
run_repl at C:\workdir\usr\share\julia\stdlib\v1.8\REPL\src\REPL.jl:355
jfptr_run_repl_66302.clone_1 at C:\Users\Joe\Documents\soft\Julia\Julia-1.8.5\lib\julia\sys.dll (unknown line)
#967 at .\client.jl:419
jfptr_YY.967_28379.clone_1 at C:\Users\Joe\Documents\soft\Julia\Julia-1.8.5\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:774
#invokelatest#2 at .\essentials.jl:729 [inlined]
invokelatest at .\essentials.jl:726 [inlined]
run_main_repl at .\client.jl:404
exec_options at .\client.jl:318
_start at .\client.jl:522
jfptr__start_54247.clone_1 at C:\Users\Joe\Documents\soft\Julia\Julia-1.8.5\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1843 [inlined]
true_main at C:/workdir/src\jlapi.c:575
jl_repl_entrypoint at C:/workdir/src\jlapi.c:719
mainCRTStartup at C:/workdir/cli\loader_exe.c:59
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 36446467 (Pool: 36404865; Big: 41602); GC: 31

Version info:

Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 6 × Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 4 on 6 virtual cores
Environment:
  JULIA_NUM_THREADS = 4
wsmoses commented 1 year ago

Lol I enjoy that what appears to happen here is that the error handler itself, errors :P

wsmoses commented 1 year ago

Should be fixed by recent jll bump, though a bit confused by the result.

@jgreener64 if you want to check.

jgreener64 commented 1 year ago

Yes seems fixed, the correct answer is ((0.5,),). middle is not the most descriptive name for what that function does.