Closed matinraayai closed 6 months ago
This is a different error from what you had on slack, and likely indicates a union return
You can work around this with Enzyme.API.strictAliasing!(false)
@wsmoses I did just that and I'm getting this new error:
Current scope:
; Function Attrs: mustprogress willreturn
define internal fastcc void @preprocess_julia_laic1__5971([3 x double]* noalias nocapture nofree noundef nonnull writeonly sret([3 x double]) align 8 dereferenceable(24) %0, i64 signext "enzyme_inactive" %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture noundef nonnull readonly align 8 dereferenceable(40) %2, double %3, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* nocapture noundef nonnull readonly align 8 dereferenceable(48) %4, double %5) unnamed_addr #130 !dbg !11001 {
top:
%6 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !154
%7 = bitcast i8* %6 to i64*, !enzyme_caststack !111
%8 = bitcast i64* %7 to i8*
%9 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !154
%10 = bitcast i8* %9 to i64*, !enzyme_caststack !111
%11 = bitcast i64* %10 to i8*
%12 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !154
%13 = bitcast i8* %12 to i64*, !enzyme_caststack !111
%14 = bitcast i64* %13 to i8*
%15 = call noalias nonnull dereferenceable(8) dereferenceable_or_null(8) i8* @malloc(i64 8), !enzyme_fromstack !154
%16 = bitcast i8* %15 to i64*, !enzyme_caststack !111
%17 = bitcast i64* %16 to i8*
%18 = call {}*** @julia.get_pgcstack() #143
%ptls_field75 = getelementptr inbounds {}**, {}*** %18, i64 2
%19 = bitcast {}*** %ptls_field75 to i64***
%ptls_load7677 = load i64**, i64*** %19, align 8, !tbaa !112
%20 = getelementptr inbounds i64*, i64** %ptls_load7677, i64 2
%safepoint = load i64*, i64** %20, align 8, !tbaa !116, !invariant.load !111
fence syncscope("singlethread") seq_cst
call void @julia.safepoint(i64* %safepoint) #143, !dbg !11002
fence syncscope("singlethread") seq_cst
%21 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 1, i64 0, i64 0, !dbg !11003
%22 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 1, i64 0, i64 1, !dbg !11012
%unbox = load i64, i64 addrspace(11)* %22, align 8, !dbg !11014, !tbaa !116, !invariant.load !111, !alias.scope !145, !noalias !146
%unbox2 = load i64, i64 addrspace(11)* %21, align 8, !dbg !11014, !tbaa !116, !invariant.load !111, !alias.scope !145, !noalias !146
%23 = add i64 %unbox, 1, !dbg !11014
%24 = sub i64 %23, %unbox2, !dbg !11016
%25 = call i64 @llvm.smax.i64(i64 %24, i64 noundef 0) #143, !dbg !11017
%26 = getelementptr inbounds { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* %4, i64 0, i32 1, i32 0, i64 0, !dbg !11022
%27 = getelementptr inbounds { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* %4, i64 0, i32 1, i32 0, i64 1, !dbg !11031
%unbox3 = load i64, i64 addrspace(11)* %27, align 8, !dbg !11033, !tbaa !116, !invariant.load !111, !alias.scope !145, !noalias !146
%unbox4 = load i64, i64 addrspace(11)* %26, align 8, !dbg !11033, !tbaa !116, !invariant.load !111, !alias.scope !145, !noalias !146
%28 = add i64 %unbox3, 1, !dbg !11033
%29 = sub i64 %28, %unbox4, !dbg !11035
%30 = call i64 @llvm.smax.i64(i64 %29, i64 noundef 0) #143, !dbg !11036
%.not = icmp eq i64 %25, %30, !dbg !11041
br i1 %.not, label %L32, label %L20, !dbg !11030
L20: ; preds = %top
%31 = call noalias nonnull {} addrspace(10)* @ijl_box_int64(i64 signext %25) #144, !dbg !11043
%32 = call noalias nonnull {} addrspace(10)* @ijl_box_int64(i64 signext %30) #144, !dbg !11043
%33 = call nonnull {} addrspace(10)* ({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)*, {} addrspace(10)*, {} addrspace(10)*, ...) @julia.call2({} addrspace(10)* ({} addrspace(10)*, {} addrspace(10)**, i32, {} addrspace(10)*)* noundef nonnull @ijl_invoke, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648999242224 to {}*) to {} addrspace(10)*), {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648974480176 to {}*) to {} addrspace(10)*), {} addrspace(10)* addrspacecast ({}* inttoptr (i64 47649081334208 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %31, {} addrspace(10)* addrspacecast ({}* inttoptr (i64 47649081334160 to {}*) to {} addrspace(10)*), {} addrspace(10)* nonnull %32) #145, !dbg !11043
%current_task978 = getelementptr inbounds {}**, {}*** %18, i64 -14, !dbg !11043
%current_task9 = bitcast {}*** %current_task978 to {}**, !dbg !11043
%box = call noalias nonnull dereferenceable(8) {} addrspace(10)* @julia.gc_alloc_obj({}** nonnull %current_task9, i64 noundef 8, {} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47649020864352 to {}*) to {} addrspace(10)*)) #146, !dbg !11043
%34 = bitcast {} addrspace(10)* %box to [1 x {} addrspace(10)*] addrspace(10)*, !dbg !11043
%35 = getelementptr [1 x {} addrspace(10)*], [1 x {} addrspace(10)*] addrspace(10)* %34, i64 0, i64 0, !dbg !11043
store {} addrspace(10)* %33, {} addrspace(10)* addrspace(10)* %35, align 8, !dbg !11043, !tbaa !166, !alias.scope !170, !noalias !11044
%36 = addrspacecast {} addrspace(10)* %box to {} addrspace(12)*, !dbg !11043
call void @ijl_throw({} addrspace(12)* %36) #147, !dbg !11043
unreachable, !dbg !11043
L32: ; preds = %top
%37 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 noundef 1) #144, !dbg !11047
%38 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 noundef 1) #144, !dbg !11049
%39 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 noundef 1) #144, !dbg !11051
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %8) #143
store i64 %1, i64* %7, align 16, !dbg !11053, !tbaa !1546, !alias.scope !170, !noalias !11044
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %11) #143
store i64 %25, i64* %10, align 16, !dbg !11053, !tbaa !1546, !alias.scope !170, !noalias !11044
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %14) #143
%40 = bitcast i64* %13 to double*, !dbg !11053
store double %3, double* %40, align 16, !dbg !11053, !tbaa !1546, !alias.scope !170, !noalias !11044
call void @llvm.lifetime.start.p0i8(i64 noundef 8, i8* noundef nonnull %17) #143
%41 = bitcast i64* %16 to double*, !dbg !11053
store double %5, double* %41, align 16, !dbg !11053, !tbaa !1546, !alias.scope !170, !noalias !11044
%getfield_addr = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 0, !dbg !11057
%getfield = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %getfield_addr unordered, align 8, !dbg !11057, !tbaa !116, !alias.scope !145, !noalias !146, !nonnull !111
%42 = addrspacecast {} addrspace(10)* %getfield to {} addrspace(11)*, !dbg !11059
%43 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %42) #148, !dbg !11059
%44 = bitcast {}* %43 to i8**, !dbg !11059
%arrayptr = load i8*, i8** %44, align 8, !dbg !11059, !tbaa !298, !alias.scope !265, !noalias !266, !nonnull !111
%45 = shl i64 %unbox2, 3, !dbg !11060
%46 = add i64 %45, -8, !dbg !11060
%47 = getelementptr i8, i8* %arrayptr, i64 %46, !dbg !11062
%48 = ptrtoint i8* %47 to i64, !dbg !11062
%getfield_addr29 = getelementptr inbounds { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* %4, i64 0, i32 0, !dbg !11057
%getfield30 = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %getfield_addr29 unordered, align 8, !dbg !11057, !tbaa !116, !alias.scope !145, !noalias !146, !nonnull !111
%49 = addrspacecast {} addrspace(10)* %getfield30 to {} addrspace(11)*, !dbg !11059
%50 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %49) #148, !dbg !11059
%51 = bitcast {}* %50 to i8**, !dbg !11059
%arrayptr32 = load i8*, i8** %51, align 8, !dbg !11059, !tbaa !116, !invariant.load !111, !alias.scope !145, !noalias !146, !nonnull !111
%52 = getelementptr inbounds { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* %4, i64 0, i32 1, i32 1, !dbg !11063
%53 = bitcast {} addrspace(10)* %getfield30 to {} addrspace(10)* addrspace(10)*, !dbg !11065
%54 = addrspacecast {} addrspace(10)* addrspace(10)* %53 to {} addrspace(10)* addrspace(11)*, !dbg !11065
%arraysize_ptr = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %54, i64 3, !dbg !11065
%55 = bitcast {} addrspace(10)* addrspace(11)* %arraysize_ptr to i64 addrspace(11)*, !dbg !11065
%arraysize = load i64, i64 addrspace(11)* %55, align 8, !dbg !11065, !tbaa !116, !range !150, !invariant.load !111, !alias.scope !145, !noalias !146
%unbox37 = load i64, i64 addrspace(11)* %52, align 8, !dbg !11069, !tbaa !116, !alias.scope !145, !noalias !146
%56 = add i64 %unbox37, 2305843009213693951, !dbg !11069
%57 = mul i64 %56, %arraysize, !dbg !11074
%58 = add i64 %57, %unbox4, !dbg !11075
%59 = shl i64 %58, 3, !dbg !11060
%60 = add i64 %59, -8, !dbg !11060
%61 = getelementptr i8, i8* %arrayptr32, i64 %60, !dbg !11062
%62 = ptrtoint i8* %61 to i64, !dbg !11062
%63 = addrspacecast {} addrspace(10)* %37 to {} addrspace(11)*, !dbg !11076
%64 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %63) #148, !dbg !11076
%65 = bitcast {}* %64 to i8**, !dbg !11076
%arrayptr43 = load i8*, i8** %65, align 8, !dbg !11076, !tbaa !298, !alias.scope !265, !noalias !266, !nonnull !111
%66 = ptrtoint i8* %arrayptr43 to i64, !dbg !11076
%67 = addrspacecast {} addrspace(10)* %38 to {} addrspace(11)*, !dbg !11076
%68 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %67) #148, !dbg !11076
%69 = bitcast {}* %68 to i8**, !dbg !11076
%arrayptr45 = load i8*, i8** %69, align 8, !dbg !11076, !tbaa !298, !alias.scope !265, !noalias !266, !nonnull !111
%70 = ptrtoint i8* %arrayptr45 to i64, !dbg !11076
%71 = addrspacecast {} addrspace(10)* %39 to {} addrspace(11)*, !dbg !11076
%72 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %71) #148, !dbg !11076
%73 = bitcast {}* %72 to i8**, !dbg !11076
%arrayptr47 = load i8*, i8** %73, align 8, !dbg !11076, !tbaa !298, !alias.scope !265, !noalias !266, !nonnull !111
%74 = ptrtoint i8* %arrayptr47 to i64, !dbg !11076
%75 = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } undef, {} addrspace(10)* %getfield30, 0, !dbg !11056
%76 = insertvalue [2 x i64] undef, i64 %unbox4, 0, !dbg !11056
%unbox48.unpack84.unpack95 = insertvalue [2 x i64] %76, i64 %unbox3, 1, !dbg !11056
%77 = insertvalue { [2 x i64], i64 } undef, [2 x i64] %unbox48.unpack84.unpack95, 0, !dbg !11056
%unbox48.unpack8492 = insertvalue { [2 x i64], i64 } %77, i64 %unbox37, 1, !dbg !11056
%78 = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %75, { [2 x i64], i64 } %unbox48.unpack8492, 1, !dbg !11056
%unbox48.elt85 = getelementptr inbounds { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* %4, i64 0, i32 2, !dbg !11056
%unbox48.unpack86 = load i64, i64 addrspace(11)* %unbox48.elt85, align 8, !dbg !11056, !tbaa !116, !alias.scope !145, !noalias !146
%79 = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %78, i64 %unbox48.unpack86, 2, !dbg !11056
%unbox48.elt87 = getelementptr inbounds { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* %4, i64 0, i32 3, !dbg !11056
%unbox48.unpack88 = load i64, i64 addrspace(11)* %unbox48.elt87, align 8, !dbg !11056, !tbaa !116, !alias.scope !145, !noalias !146
%unbox4889 = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %79, i64 %unbox48.unpack88, 3, !dbg !11056
%80 = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } undef, {} addrspace(10)* %getfield, 0, !dbg !11056
%81 = insertvalue [2 x i64] undef, i64 %unbox2, 0, !dbg !11056
%unbox49.unpack97.unpack106 = insertvalue [2 x i64] %81, i64 %unbox, 1, !dbg !11056
%unbox49.unpack97103 = insertvalue [1 x [2 x i64]] undef, [2 x i64] %unbox49.unpack97.unpack106, 0, !dbg !11056
%82 = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %80, [1 x [2 x i64]] %unbox49.unpack97103, 1, !dbg !11056
%unbox49.elt98 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 2, !dbg !11056
%unbox49.unpack99 = load i64, i64 addrspace(11)* %unbox49.elt98, align 8, !dbg !11056, !tbaa !116, !alias.scope !145, !noalias !146
%83 = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %82, i64 %unbox49.unpack99, 2, !dbg !11056
%unbox49.elt100 = getelementptr inbounds { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* %2, i64 0, i32 3, !dbg !11056
%unbox49.unpack101 = load i64, i64 addrspace(11)* %unbox49.elt100, align 8, !dbg !11056, !tbaa !116, !alias.scope !145, !noalias !146
%unbox49102 = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %83, i64 %unbox49.unpack101, 3, !dbg !11056
call void @dlaic1_64_(i8* noundef nonnull %8, i8* noundef nonnull %11, i64 %48, i8* noundef nonnull %14, i64 %62, i8* noundef nonnull %17, i64 %66, i64 %70, i64 %74) #143 [ "jl_roots"({} addrspace(10)* %39, {} addrspace(10)* %38, {} addrspace(10)* %37, {} addrspace(10)* null, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %unbox4889, {} addrspace(10)* null, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %unbox49102, {} addrspace(10)* null, {} addrspace(10)* null) ], !dbg !11056
%84 = bitcast {} addrspace(10)* %37 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !11077
%85 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %84 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !11077
%arraylen_ptr = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %85, i64 0, i32 1, !dbg !11077
%arraylen = load i64, i64 addrspace(11)* %arraylen_ptr, align 8, !dbg !11077, !tbaa !262, !range !150, !alias.scope !265, !noalias !266
%inbounds.not = icmp eq i64 %arraylen, 0, !dbg !11077
br i1 %inbounds.not, label %oob, label %idxend, !dbg !11077
oob: ; preds = %L32
%errorbox = alloca i64, align 8, !dbg !11077
store i64 1, i64* %errorbox, align 8, !dbg !11077, !noalias !11079
%86 = addrspacecast {} addrspace(10)* %37 to {} addrspace(12)*, !dbg !11077
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %8) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %11) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %14) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %17) #143
call void @ijl_bounds_error_ints({} addrspace(12)* %86, i64* noundef nonnull align 8 %errorbox, i64 noundef 1) #147, !dbg !11077
unreachable, !dbg !11077
idxend: ; preds = %L32
%87 = bitcast {} addrspace(10)* %37 to double addrspace(13)* addrspace(10)*, !dbg !11077
%88 = addrspacecast double addrspace(13)* addrspace(10)* %87 to double addrspace(13)* addrspace(11)*, !dbg !11077
%arrayptr54107 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %88, align 8, !dbg !11077, !tbaa !298, !alias.scope !11080, !noalias !266, !nonnull !111
%arrayref = load double, double addrspace(13)* %arrayptr54107, align 8, !dbg !11077, !tbaa !293, !alias.scope !170, !noalias !295
%89 = bitcast {} addrspace(10)* %38 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !11077
%90 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %89 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !11077
%arraylen_ptr55 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %90, i64 0, i32 1, !dbg !11077
%arraylen56 = load i64, i64 addrspace(11)* %arraylen_ptr55, align 8, !dbg !11077, !tbaa !262, !range !150, !alias.scope !265, !noalias !266
%inbounds57.not = icmp eq i64 %arraylen56, 0, !dbg !11077
br i1 %inbounds57.not, label %oob58, label %idxend60, !dbg !11077
oob58: ; preds = %idxend
%errorbox59 = alloca i64, align 8, !dbg !11077
store i64 1, i64* %errorbox59, align 8, !dbg !11077, !noalias !11079
%91 = addrspacecast {} addrspace(10)* %38 to {} addrspace(12)*, !dbg !11077
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %8) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %11) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %14) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %17) #143
call void @ijl_bounds_error_ints({} addrspace(12)* %91, i64* noundef nonnull align 8 %errorbox59, i64 noundef 1) #147, !dbg !11077
unreachable, !dbg !11077
idxend60: ; preds = %idxend
%92 = bitcast {} addrspace(10)* %39 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !11077
%93 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %92 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !11077
%arraylen_ptr64 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %93, i64 0, i32 1, !dbg !11077
%arraylen65 = load i64, i64 addrspace(11)* %arraylen_ptr64, align 8, !dbg !11077, !tbaa !262, !range !150, !alias.scope !265, !noalias !266
%inbounds66.not = icmp eq i64 %arraylen65, 0, !dbg !11077
br i1 %inbounds66.not, label %oob67, label %idxend69, !dbg !11077
oob67: ; preds = %idxend60
%errorbox68 = alloca i64, align 8, !dbg !11077
store i64 1, i64* %errorbox68, align 8, !dbg !11077, !noalias !11079
%94 = addrspacecast {} addrspace(10)* %39 to {} addrspace(12)*, !dbg !11077
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %8) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %11) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %14) #143
call void @llvm.lifetime.end.p0i8(i64 noundef 8, i8* noundef nonnull %17) #143
call void @ijl_bounds_error_ints({} addrspace(12)* %94, i64* noundef nonnull align 8 %errorbox68, i64 noundef 1) #147, !dbg !11077
unreachable, !dbg !11077
idxend69: ; preds = %idxend60
%95 = bitcast {} addrspace(10)* %38 to double addrspace(13)* addrspace(10)*, !dbg !11077
%96 = addrspacecast double addrspace(13)* addrspace(10)* %95 to double addrspace(13)* addrspace(11)*, !dbg !11077
%arrayptr62108 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %96, align 8, !dbg !11077, !tbaa !298, !alias.scope !11080, !noalias !266, !nonnull !111
%arrayref63 = load double, double addrspace(13)* %arrayptr62108, align 8, !dbg !11077, !tbaa !293, !alias.scope !170, !noalias !295
%97 = bitcast {} addrspace(10)* %39 to double addrspace(13)* addrspace(10)*, !dbg !11077
%98 = addrspacecast double addrspace(13)* addrspace(10)* %97 to double addrspace(13)* addrspace(11)*, !dbg !11077
%arrayptr71109 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %98, align 8, !dbg !11077, !tbaa !298, !alias.scope !11080, !noalias !266, !nonnull !111
%arrayref72 = load double, double addrspace(13)* %arrayptr71109, align 8, !dbg !11077, !tbaa !293, !alias.scope !170, !noalias !295
%newstruct73.sroa.0.0..sroa_idx = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0, !dbg !11078
store double %arrayref, double* %newstruct73.sroa.0.0..sroa_idx, align 8, !dbg !11078, !noalias !11079
%newstruct73.sroa.2.0..sroa_idx110 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1, !dbg !11078
store double %arrayref63, double* %newstruct73.sroa.2.0..sroa_idx110, align 8, !dbg !11078, !noalias !11079
%newstruct73.sroa.3.0..sroa_idx111 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2, !dbg !11078
store double %arrayref72, double* %newstruct73.sroa.3.0..sroa_idx111, align 8, !dbg !11078, !noalias !11079
ret void, !dbg !11078
}
Illegal replace ficticious phi for: %unbox49.unpack101_replacementA = phi i64 , !dbg !192 of %unbox49.unpack101 = load i64, i64 addrspace(11)* %unbox49.elt100, align 8, !dbg !218, !tbaa !117, !alias.scope !148, !noalias !151
; Function Attrs: mustprogress willreturn
define internal fastcc { double, double } @diffejulia_laic1__5971([3 x double]* noalias nocapture nofree writeonly sret([3 x double]) align 8 dereferenceable(24) "enzyme_sret" %0, [3 x double]* nocapture nofree align 8 "enzyme_sret" %"'", i64 signext "enzyme_inactive" %1, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture readonly align 8 dereferenceable(40) %2, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } addrspace(11)* nocapture align 8 %"'1", double %3, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* nocapture readonly align 8 dereferenceable(48) %4, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } addrspace(11)* nocapture align 8 %"'2", double %5, { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg) unnamed_addr #130 !dbg !17365 {
top:
%"'mi" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 6
%6 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 7
%"'ipc" = bitcast i8* %"'mi" to i64*
%7 = bitcast i8* %6 to i64*, !enzyme_caststack !111
%"'ipc36" = bitcast i64* %"'ipc" to i8*
%8 = bitcast i64* %7 to i8*
%"'mi26" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 4
%9 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 5
%"'ipc37" = bitcast i8* %"'mi26" to i64*
%10 = bitcast i8* %9 to i64*, !enzyme_caststack !111
%"'ipc38" = bitcast i64* %"'ipc37" to i8*
%11 = bitcast i64* %10 to i8*
%"'mi25" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 2
%12 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 3
%"'ipc40" = bitcast i8* %"'mi25" to i64*
%13 = bitcast i8* %12 to i64*, !enzyme_caststack !111
%"'ipc41" = bitcast i64* %"'ipc40" to i8*
%14 = bitcast i64* %13 to i8*
%"'mi24" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 0
%15 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 1
%"'ipc44" = bitcast i8* %"'mi24" to i64*
%16 = bitcast i8* %15 to i64*, !enzyme_caststack !111
%"'ipc45" = bitcast i64* %"'ipc44" to i8*
%17 = bitcast i64* %16 to i8*
%18 = call {}*** @julia.get_pgcstack() #143
%ptls_field75_replacementA = phi {}***
%ptls_load7677_replacementA = phi i64**
%_replacementA20 = phi i64 addrspace(11)* , !dbg !17366
%unbox_replacementA = phi i64 , !dbg !17375
%unbox2 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 13, !dbg !17375
%_replacementA19 = phi i64 , !dbg !17375
%_replacementA18 = phi i64 , !dbg !17377
%_replacementA17 = phi i64 , !dbg !17378
%_replacementA16 = phi i64 addrspace(11)* , !dbg !17383
%_replacementA15 = phi i64 addrspace(11)* , !dbg !17392
%unbox3_replacementA = phi i64 , !dbg !17394
%unbox4_replacementA = phi i64 , !dbg !17394
%_replacementA14 = phi i64 , !dbg !17394
%_replacementA13 = phi i64 , !dbg !17396
%_replacementA = phi i64 , !dbg !17397
%.not_replacementA = phi i1 , !dbg !17402
br i1 true, label %L32, label %L20, !dbg !17391
L20: ; preds = %top
%_replacementA33 = phi {} addrspace(10)* , !dbg !17404
%_replacementA32 = phi {} addrspace(10)* , !dbg !17404
%_replacementA31 = phi {} addrspace(10)* , !dbg !17404
%current_task978_replacementA = phi {}*** , !dbg !17404
%current_task9_replacementA = phi {}** , !dbg !17404
%box_replacementA = phi {} addrspace(10)* , !dbg !17404
%_replacementA30 = phi [1 x {} addrspace(10)*] addrspace(10)* , !dbg !17404
%_replacementA28 = phi {} addrspace(12)* , !dbg !17404
unreachable
L32: ; preds = %top
%19 = call {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 1), !dbg !17405
%20 = bitcast {} addrspace(10)* %19 to i8 addrspace(13)* addrspace(10)*, !dbg !17405
%21 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(10)* %20, align 8, !dbg !17405
call void @llvm.memset.p13i8.i64(i8 addrspace(13)* align 8 %21, i8 0, i64 8, i1 false), !dbg !17405
%22 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 noundef 1) #144, !dbg !17405
%23 = call {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 1), !dbg !17407
%24 = bitcast {} addrspace(10)* %23 to i8 addrspace(13)* addrspace(10)*, !dbg !17407
%25 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(10)* %24, align 8, !dbg !17407
call void @llvm.memset.p13i8.i64(i8 addrspace(13)* align 8 %25, i8 0, i64 8, i1 false), !dbg !17407
%26 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 noundef 1) #144, !dbg !17407
%27 = call {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 1), !dbg !17409
%28 = bitcast {} addrspace(10)* %27 to i8 addrspace(13)* addrspace(10)*, !dbg !17409
%29 = load i8 addrspace(13)*, i8 addrspace(13)* addrspace(10)* %28, align 8, !dbg !17409
call void @llvm.memset.p13i8.i64(i8 addrspace(13)* align 8 %29, i8 0, i64 8, i1 false), !dbg !17409
%30 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 47648974261088 to {}*) to {} addrspace(10)*), i64 noundef 1) #144, !dbg !17409
%"'ipc92" = bitcast i64* %"'ipc40" to double*, !dbg !17411
%_replacementA93 = phi double* , !dbg !17411
%"'ipc90" = bitcast i64* %"'ipc44" to double*, !dbg !17411
%_replacementA91 = phi double* , !dbg !17411
%getfield_addr_replacementA = phi {} addrspace(10)* addrspace(11)* , !dbg !17415
%"getfield'il_phi" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 12, !dbg !17415
%getfield_replacementA = phi {} addrspace(10)* , !dbg !17415
%"'ipc87" = addrspacecast {} addrspace(10)* %"getfield'il_phi" to {} addrspace(11)*, !dbg !17417
%_replacementA89 = phi {} addrspace(11)* , !dbg !17417
%31 = call {}* @julia.pointer_from_objref({} addrspace(11)* %"'ipc87"), !dbg !17417
%_replacementA88 = phi {}* , !dbg !17417
%_replacementA86 = phi i8** , !dbg !17417
%"arrayptr'il_phi" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 11, !dbg !17417
%arrayptr_replacementA = phi i8* , !dbg !17417
%32 = shl i64 %unbox2, 3, !dbg !17418
%33 = add i64 %32, -8, !dbg !17418
%"'ipg" = getelementptr i8, i8* %"arrayptr'il_phi", i64 %33, !dbg !17420
%_replacementA85 = phi i8* , !dbg !17420
%"'ipc39" = ptrtoint i8* %"'ipg" to i64, !dbg !17420
%34 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 14, !dbg !17415
%getfield_addr29_replacementA = phi {} addrspace(10)* addrspace(11)* , !dbg !17415
%"getfield30'il_phi" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 10, !dbg !17415
%getfield30_replacementA = phi {} addrspace(10)* , !dbg !17415
%"'ipc82" = addrspacecast {} addrspace(10)* %"getfield30'il_phi" to {} addrspace(11)*, !dbg !17417
%_replacementA84 = phi {} addrspace(11)* , !dbg !17417
%35 = call {}* @julia.pointer_from_objref({} addrspace(11)* %"'ipc82"), !dbg !17417
%_replacementA83 = phi {}* , !dbg !17417
%_replacementA81 = phi i8** , !dbg !17417
%"arrayptr32'il_phi" = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 9, !dbg !17417
%arrayptr32_replacementA = phi i8* , !dbg !17417
%_replacementA78 = phi {} addrspace(10)* addrspace(11)* , !dbg !17421
%arraysize_ptr_replacementA = phi {} addrspace(10)* addrspace(11)* , !dbg !17421
%_replacementA77 = phi i64 addrspace(11)* , !dbg !17421
%arraysize_replacementA = phi i64 , !dbg !17421
%unbox37_replacementA = phi i64 , !dbg !17425
%_replacementA76 = phi i64 , !dbg !17425
%_replacementA75 = phi i64 , !dbg !17430
%_replacementA74 = phi i64 , !dbg !17431
%36 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 15, !dbg !17418
%37 = add i64 %36, -8, !dbg !17418
%"'ipg42" = getelementptr i8, i8* %"arrayptr32'il_phi", i64 %37, !dbg !17420
%_replacementA73 = phi i8* , !dbg !17420
%"'ipc43" = ptrtoint i8* %"'ipg42" to i64, !dbg !17420
%38 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 16, !dbg !17432
%"'ipc72" = addrspacecast {} addrspace(10)* %19 to {} addrspace(11)*, !dbg !17432
%39 = addrspacecast {} addrspace(10)* %22 to {} addrspace(11)*, !dbg !17432
%40 = call {}* @julia.pointer_from_objref({} addrspace(11)* %"'ipc72"), !dbg !17432
%41 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %39) #145, !dbg !17432
%"'ipc71" = bitcast {}* %40 to i8**, !dbg !17432
%42 = bitcast {}* %41 to i8**, !dbg !17432
%"arrayptr43'ipl" = load i8*, i8** %"'ipc71", align 8, !dbg !17432, !tbaa !298, !alias.scope !17433, !noalias !17436, !nonnull !111
%arrayptr43 = load i8*, i8** %42, align 8, !dbg !17432, !tbaa !298, !alias.scope !17438, !noalias !17439, !nonnull !111
%"'ipc46" = ptrtoint i8* %"arrayptr43'ipl" to i64, !dbg !17432
%43 = ptrtoint i8* %arrayptr43 to i64, !dbg !17432
%"'ipc70" = addrspacecast {} addrspace(10)* %23 to {} addrspace(11)*, !dbg !17432
%44 = addrspacecast {} addrspace(10)* %26 to {} addrspace(11)*, !dbg !17432
%45 = call {}* @julia.pointer_from_objref({} addrspace(11)* %"'ipc70"), !dbg !17432
%46 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %44) #145, !dbg !17432
%"'ipc69" = bitcast {}* %45 to i8**, !dbg !17432
%47 = bitcast {}* %46 to i8**, !dbg !17432
%"arrayptr45'ipl" = load i8*, i8** %"'ipc69", align 8, !dbg !17432, !tbaa !298, !alias.scope !17440, !noalias !17443, !nonnull !111
%arrayptr45 = load i8*, i8** %47, align 8, !dbg !17432, !tbaa !298, !alias.scope !17445, !noalias !17446, !nonnull !111
%"'ipc47" = ptrtoint i8* %"arrayptr45'ipl" to i64, !dbg !17432
%48 = ptrtoint i8* %arrayptr45 to i64, !dbg !17432
%"'ipc68" = addrspacecast {} addrspace(10)* %27 to {} addrspace(11)*, !dbg !17432
%49 = addrspacecast {} addrspace(10)* %30 to {} addrspace(11)*, !dbg !17432
%50 = call {}* @julia.pointer_from_objref({} addrspace(11)* %"'ipc68"), !dbg !17432
%51 = call nonnull {}* @julia.pointer_from_objref({} addrspace(11)* %49) #145, !dbg !17432
%"'ipc67" = bitcast {}* %50 to i8**, !dbg !17432
%52 = bitcast {}* %51 to i8**, !dbg !17432
%"arrayptr47'ipl" = load i8*, i8** %"'ipc67", align 8, !dbg !17432, !tbaa !298, !alias.scope !17447, !noalias !17450, !nonnull !111
%arrayptr47 = load i8*, i8** %52, align 8, !dbg !17432, !tbaa !298, !alias.scope !17452, !noalias !17453, !nonnull !111
%"'ipc48" = ptrtoint i8* %"arrayptr47'ipl" to i64, !dbg !17432
%53 = ptrtoint i8* %arrayptr47 to i64, !dbg !17432
%"'ipiv" = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } undef, {} addrspace(10)* %"getfield30'il_phi", 0, !dbg !17414
%_replacementA66 = phi { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } , !dbg !17414
%"'ipiv50" = insertvalue [2 x i64] undef, i64 %unbox4_replacementA, 0, !dbg !17414
%_replacementA65 = phi [2 x i64] , !dbg !17414
%"unbox48.unpack84.unpack95'ipiv" = insertvalue [2 x i64] %"'ipiv50", i64 %unbox3_replacementA, 1, !dbg !17414
%unbox48.unpack84.unpack95_replacementA = phi [2 x i64] , !dbg !17414
%"'ipiv51" = insertvalue { [2 x i64], i64 } undef, [2 x i64] %"unbox48.unpack84.unpack95'ipiv", 0, !dbg !17414
%_replacementA64 = phi { [2 x i64], i64 } , !dbg !17414
%"unbox48.unpack8492'ipiv" = insertvalue { [2 x i64], i64 } %"'ipiv51", i64 %unbox37_replacementA, 1, !dbg !17414
%unbox48.unpack8492_replacementA = phi { [2 x i64], i64 } , !dbg !17414
%"'ipiv52" = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %"'ipiv", { [2 x i64], i64 } %"unbox48.unpack8492'ipiv", 1, !dbg !17414
%_replacementA63 = phi { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } , !dbg !17414
%unbox48.elt85_replacementA = phi i64 addrspace(11)* , !dbg !17414
%unbox48.unpack86_replacementA = phi i64 , !dbg !17414
%"'ipiv53" = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %"'ipiv52", i64 %unbox48.unpack86_replacementA, 2, !dbg !17414
%_replacementA62 = phi { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } , !dbg !17414
%unbox48.elt87_replacementA = phi i64 addrspace(11)* , !dbg !17414
%unbox48.unpack88_replacementA = phi i64 , !dbg !17414
%"unbox4889'ipiv" = insertvalue { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %"'ipiv53", i64 %unbox48.unpack88_replacementA, 3, !dbg !17414
%unbox4889 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 17, !dbg !17414
%"'ipiv54" = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } undef, {} addrspace(10)* %"getfield'il_phi", 0, !dbg !17414
%_replacementA61 = phi { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } , !dbg !17414
%"'ipiv55" = insertvalue [2 x i64] undef, i64 %unbox2, 0, !dbg !17414
%_replacementA60 = phi [2 x i64] , !dbg !17414
%"unbox49.unpack97.unpack106'ipiv" = insertvalue [2 x i64] %"'ipiv55", i64 %unbox_replacementA, 1, !dbg !17414
%unbox49.unpack97.unpack106_replacementA = phi [2 x i64] , !dbg !17414
%"unbox49.unpack97103'ipiv" = insertvalue [1 x [2 x i64]] undef, [2 x i64] %"unbox49.unpack97.unpack106'ipiv", 0, !dbg !17414
%unbox49.unpack97103_replacementA = phi [1 x [2 x i64]] , !dbg !17414
%"'ipiv56" = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %"'ipiv54", [1 x [2 x i64]] %"unbox49.unpack97103'ipiv", 1, !dbg !17414
%_replacementA59 = phi { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } , !dbg !17414
%unbox49.elt98_replacementA = phi i64 addrspace(11)* , !dbg !17414
%unbox49.unpack99_replacementA = phi i64 , !dbg !17414
%"'ipiv57" = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %"'ipiv56", i64 %unbox49.unpack99_replacementA, 2, !dbg !17414
%_replacementA58 = phi { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } , !dbg !17414
%unbox49.elt100_replacementA = phi i64 addrspace(11)* , !dbg !17414
%unbox49.unpack101_replacementA = phi i64 , !dbg !17414
%"unbox49102'ipiv" = insertvalue { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %"'ipiv57", i64 %unbox49.unpack101_replacementA, 3, !dbg !17414
%unbox49102 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 18, !dbg !17414
%tapeArg49 = extractvalue { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i8*, {} addrspace(10)*, i64, i64, i64, i64, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 }, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } } %tapeArg, 8, !dbg !17414
%_replacementA35 = phi { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* , !dbg !17454
%_replacementA34 = phi { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* , !dbg !17454
%arraylen_ptr_replacementA = phi i64 addrspace(11)* , !dbg !17454
%arraylen_replacementA = phi i64 , !dbg !17454
%inbounds.not_replacementA = phi i1 , !dbg !17454
br i1 false, label %oob, label %idxend, !dbg !17454
oob: ; preds = %L32
%errorbox_replacementA = phi i64* , !dbg !17454
unreachable
idxend: ; preds = %L32
%"'ipc97" = bitcast {} addrspace(10)* %19 to double addrspace(13)* addrspace(10)*, !dbg !17454
%_replacementA100 = phi double addrspace(13)* addrspace(10)* , !dbg !17454
%"'ipc98" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc97" to double addrspace(13)* addrspace(11)*, !dbg !17454
%_replacementA99 = phi double addrspace(13)* addrspace(11)* , !dbg !17454
%"arrayptr54107'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc98", align 8, !dbg !17454, !tbaa !298, !alias.scope !17456, !noalias !17436, !nonnull !111
%arrayptr54107_replacementA = phi double addrspace(13)* , !dbg !17454
%arrayref_replacementA = phi double , !dbg !17454
%_replacementA96 = phi { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* , !dbg !17454
%_replacementA95 = phi { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* , !dbg !17454
%arraylen_ptr55_replacementA = phi i64 addrspace(11)* , !dbg !17454
%arraylen56_replacementA = phi i64 , !dbg !17454
%inbounds57.not_replacementA = phi i1 , !dbg !17454
br i1 false, label %oob58, label %idxend60, !dbg !17454
oob58: ; preds = %idxend
%errorbox59_replacementA = phi i64* , !dbg !17454
unreachable
idxend60: ; preds = %idxend
%arraylen_ptr64_replacementA = phi i64 addrspace(11)* , !dbg !17454
%inbounds66.not_replacementA = phi i1 , !dbg !17454
br i1 false, label %oob67, label %idxend69, !dbg !17454
oob67: ; preds = %idxend60
%errorbox68_replacementA = phi i64* , !dbg !17454
%_replacementA104 = phi {} addrspace(12)* , !dbg !17454
unreachable
idxend69: ; preds = %idxend60
%"'ipc109" = bitcast {} addrspace(10)* %23 to double addrspace(13)* addrspace(10)*, !dbg !17454
%_replacementA112 = phi double addrspace(13)* addrspace(10)* , !dbg !17454
%"'ipc110" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc109" to double addrspace(13)* addrspace(11)*, !dbg !17454
%_replacementA111 = phi double addrspace(13)* addrspace(11)* , !dbg !17454
%"arrayptr62108'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc110", align 8, !dbg !17454, !tbaa !298, !alias.scope !17457, !noalias !17443, !nonnull !111
%arrayptr62108_replacementA = phi double addrspace(13)* , !dbg !17454
%arrayref63_replacementA = phi double , !dbg !17454
%"'ipc105" = bitcast {} addrspace(10)* %27 to double addrspace(13)* addrspace(10)*, !dbg !17454
%"'ipc106" = addrspacecast double addrspace(13)* addrspace(10)* %"'ipc105" to double addrspace(13)* addrspace(11)*, !dbg !17454
%_replacementA107 = phi double addrspace(13)* addrspace(11)* , !dbg !17454
%"arrayptr71109'ipl" = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %"'ipc106", align 8, !dbg !17454, !tbaa !298, !alias.scope !17458, !noalias !17450, !nonnull !111
%arrayref72_replacementA = phi double , !dbg !17454
%"newstruct73.sroa.0.0..sroa_idx'ipg" = getelementptr inbounds [3 x double], [3 x double]* %"'", i64 0, i64 0, !dbg !17455
%newstruct73.sroa.0.0..sroa_idx_replacementA = phi double* , !dbg !17455
%"newstruct73.sroa.2.0..sroa_idx110'ipg" = getelementptr inbounds [3 x double], [3 x double]* %"'", i64 0, i64 1, !dbg !17455
%newstruct73.sroa.2.0..sroa_idx110_replacementA = phi double* , !dbg !17455
%"newstruct73.sroa.3.0..sroa_idx111'ipg" = getelementptr inbounds [3 x double], [3 x double]* %"'", i64 0, i64 2, !dbg !17455
%newstruct73.sroa.3.0..sroa_idx111_replacementA = phi double* , !dbg !17455
br label %invertidxend69, !dbg !17455
allocsForInversion: ; No predecessors!
%"'de" = alloca double, align 8
%54 = getelementptr double, double* %"'de", i64 0
store double 0.000000e+00, double* %54, align 8
%"'de27" = alloca double, align 8
%55 = getelementptr double, double* %"'de27", i64 0
store double 0.000000e+00, double* %55, align 8
%"arrayref'de" = alloca double, align 8
%56 = getelementptr double, double* %"arrayref'de", i64 0
store double 0.000000e+00, double* %56, align 8
%"arrayref72'de" = alloca double, align 8
%57 = getelementptr double, double* %"arrayref72'de", i64 0
store double 0.000000e+00, double* %57, align 8
%"arrayref63'de" = alloca double, align 8
%58 = getelementptr double, double* %"arrayref63'de", i64 0
store double 0.000000e+00, double* %58, align 8
inverttop: ; preds = %invertL32
fence syncscope("singlethread") seq_cst
fence syncscope("singlethread") seq_cst
call void @free(i8* nonnull %"'mi24")
call void @free(i8* %15)
call void @free(i8* nonnull %"'mi25")
call void @free(i8* %12)
call void @free(i8* nonnull %"'mi26")
call void @free(i8* %9)
call void @free(i8* nonnull %"'mi")
call void @free(i8* %6)
%59 = load double, double* %"'de", align 8
%60 = load double, double* %"'de27", align 8
%61 = insertvalue { double, double } undef, double %59, 0
%62 = insertvalue { double, double } %61, double %60, 1
ret { double, double } %62
invertL20: ; No predecessors!
invertL32: ; preds = %invertidxend
call void inttoptr (i64 47653617007840 to void (i8*)*)(i8* getelementptr inbounds ([21983 x i8], [21983 x i8]* @61, i32 0, i32 0)) #146, !dbg !17414
call void @diffedlaic1_64_(i8* %8, i8* %"'ipc36", i8* %11, i8* %"'ipc38", i64 %34, i64 %"'ipc39", i8* %14, i8* %"'ipc41", i64 %38, i64 %"'ipc43", i8* %17, i8* %"'ipc45", i64 %43, i64 %"'ipc46", i64 %48, i64 %"'ipc47", i64 %53, i64 %"'ipc48", {} addrspace(10)* %tapeArg49) [ "jl_roots"({} addrspace(10)* %30, {} addrspace(10)* %27, {} addrspace(10)* %26, {} addrspace(10)* %23, {} addrspace(10)* %22, {} addrspace(10)* %19, {} addrspace(10)* null, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %unbox4889, { {} addrspace(10)*, { [2 x i64], i64 }, i64, i64 } %"unbox4889'ipiv", {} addrspace(10)* null, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %unbox49102, { {} addrspace(10)*, [1 x [2 x i64]], i64, i64 } %"unbox49102'ipiv", {} addrspace(10)* null, {} addrspace(10)* null) ], !dbg !17414
%63 = load double, double* %"'ipc90", align 16, !dbg !17411, !tbaa !1546, !alias.scope !17459, !noalias !17462
store double 0.000000e+00, double* %"'ipc90", align 16, !dbg !17411, !tbaa !1546, !alias.scope !17459, !noalias !17462
%64 = load double, double* %"'de27", align 8, !dbg !17411
%65 = fadd fast double %64, %63, !dbg !17411
store double %65, double* %"'de27", align 8, !dbg !17411
%66 = load double, double* %"'ipc92", align 16, !dbg !17411, !tbaa !1546, !alias.scope !17464, !noalias !17467
store double 0.000000e+00, double* %"'ipc92", align 16, !dbg !17411, !tbaa !1546, !alias.scope !17464, !noalias !17467
%67 = load double, double* %"'de", align 8, !dbg !17411
%68 = fadd fast double %67, %66, !dbg !17411
store double %68, double* %"'de", align 8, !dbg !17411
br label %inverttop
invertoob: ; No predecessors!
invertidxend: ; preds = %invertidxend60
%69 = load double, double* %"arrayref'de", align 8, !dbg !17454
store double 0.000000e+00, double* %"arrayref'de", align 8, !dbg !17454
%70 = load double, double addrspace(13)* %"arrayptr54107'ipl", align 8, !dbg !17454, !tbaa !293, !alias.scope !17469, !noalias !17472
%71 = fadd fast double %70, %69, !dbg !17454
store double %71, double addrspace(13)* %"arrayptr54107'ipl", align 8, !dbg !17454, !tbaa !293, !alias.scope !17469, !noalias !17472
br label %invertL32
invertoob58: ; No predecessors!
invertidxend60: ; preds = %invertidxend69
br label %invertidxend
invertoob67: ; No predecessors!
invertidxend69: ; preds = %idxend69
%72 = load double, double* %"newstruct73.sroa.3.0..sroa_idx111'ipg", align 8, !dbg !17455, !alias.scope !17474, !noalias !17477
store double 0.000000e+00, double* %"newstruct73.sroa.3.0..sroa_idx111'ipg", align 8, !dbg !17455, !alias.scope !17474, !noalias !17477
%73 = load double, double* %"arrayref72'de", align 8, !dbg !17455
%74 = fadd fast double %73, %72, !dbg !17455
store double %74, double* %"arrayref72'de", align 8, !dbg !17455
%75 = load double, double* %"newstruct73.sroa.2.0..sroa_idx110'ipg", align 8, !dbg !17455, !alias.scope !17474, !noalias !17477
store double 0.000000e+00, double* %"newstruct73.sroa.2.0..sroa_idx110'ipg", align 8, !dbg !17455, !alias.scope !17474, !noalias !17477
%76 = load double, double* %"arrayref63'de", align 8, !dbg !17455
%77 = fadd fast double %76, %75, !dbg !17455
store double %77, double* %"arrayref63'de", align 8, !dbg !17455
%78 = load double, double* %"newstruct73.sroa.0.0..sroa_idx'ipg", align 8, !dbg !17455, !alias.scope !17474, !noalias !17477
store double 0.000000e+00, double* %"newstruct73.sroa.0.0..sroa_idx'ipg", align 8, !dbg !17455, !alias.scope !17474, !noalias !17477
%79 = load double, double* %"arrayref'de", align 8, !dbg !17455
%80 = fadd fast double %79, %78, !dbg !17455
store double %80, double* %"arrayref'de", align 8, !dbg !17455
%81 = load double, double* %"arrayref72'de", align 8, !dbg !17454
store double 0.000000e+00, double* %"arrayref72'de", align 8, !dbg !17454
%82 = load double, double addrspace(13)* %"arrayptr71109'ipl", align 8, !dbg !17454, !tbaa !293, !alias.scope !17479, !noalias !17482
%83 = fadd fast double %82, %81, !dbg !17454
store double %83, double addrspace(13)* %"arrayptr71109'ipl", align 8, !dbg !17454, !tbaa !293, !alias.scope !17479, !noalias !17482
%84 = load double, double* %"arrayref63'de", align 8, !dbg !17454
store double 0.000000e+00, double* %"arrayref63'de", align 8, !dbg !17454
%85 = load double, double addrspace(13)* %"arrayptr62108'ipl", align 8, !dbg !17454, !tbaa !293, !alias.scope !17484, !noalias !17487
%86 = fadd fast double %85, %84, !dbg !17454
store double %86, double addrspace(13)* %"arrayptr62108'ipl", align 8, !dbg !17454, !tbaa !293, !alias.scope !17484, !noalias !17487
br label %invertidxend60
}
LLVM.LoadInst(%unbox49.unpack101 = load i64, i64 addrspace(11)* %unbox49.elt100, align 8, !dbg !218, !tbaa !117, !alias.scope !148, !noalias !151)
LLVM.PHIInst(%unbox49.unpack101_replacementA = phi i64 , !dbg !192)
Stacktrace:
[1] laic1!
@ ~/modules/julia/1.10.0/julia-1.10.0-rc1/share/julia/stdlib/v1.10/LinearAlgebra/src/lapack.jl:2522
Stacktrace:
[1] julia_error(cstr::Cstring, val::Ptr{LLVM.API.LLVMOpaqueValue}, errtype::Enzyme.API.ErrorType, data::Ptr{Nothing}, data2::Ptr{LLVM.API.LLVMOpaqueValue}, B::Ptr{LLVM.API.LLVMOpaqueBuilder})
@ Enzyme.Compiler ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:5902
[2] EnzymeCreatePrimalAndGradient(logic::Enzyme.Logic, todiff::LLVM.Function, retType::Enzyme.API.CDIFFE_TYPE, constant_args::Vector{Enzyme.API.CDIFFE_TYPE}, TA::Enzyme.TypeAnalysis, returnValue::Bool, dretUsed::Bool, mode::Enzyme.API.CDerivativeMode, width::Int64, additionalArg::Ptr{Nothing}, forceAnonymousTape::Bool, typeInfo::Enzyme.FnTypeInfo, uncacheable_args::Vector{Bool}, augmented::Ptr{Nothing}, atomicAdd::Bool)
@ Enzyme.API ~/.julia/packages/Enzyme/rbuCz/src/api.jl:141
[3] enzyme!(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, mod::LLVM.Module, primalf::LLVM.Function, TT::Type, mode::Enzyme.API.CDerivativeMode, width::Int64, parallel::Bool, actualRetType::Type, wrap::Bool, modifiedBetween::NTuple{5, Bool}, returnPrimal::Bool, jlrules::Vector{String}, expectedTapeType::Type, loweredArgs::Set{Int64}, boxedArgs::Set{Int64})
@ Enzyme.Compiler ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:7726
[4] codegen(output::Symbol, job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, toplevel::Bool, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:9278
[5] codegen
@ ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:8886 [inlined]
[6] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, postopt::Bool) (repeats 2 times)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:9830
[7] cached_compilation
@ ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:9864 [inlined]
[8] (::Enzyme.Compiler.var"#474#475"{DataType, DataType, DataType, Enzyme.API.CDerivativeMode, NTuple{5, Bool}, Int64, Bool, Bool, UInt64, DataType})(ctx::LLVM.Context)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:9921
[9] JuliaContext(f::Enzyme.Compiler.var"#474#475"{DataType, DataType, DataType, Enzyme.API.CDerivativeMode, NTuple{5, Bool}, Int64, Bool, Bool, UInt64, DataType})
@ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:47
[10] #s325#473
@ ~/.julia/packages/Enzyme/rbuCz/src/compiler.jl:9882 [inlined]
[11] var"#s325#473"(FA::Any, A::Any, TT::Any, Mode::Any, ModifiedBetween::Any, width::Any, ReturnPrimal::Any, ShadowInit::Any, World::Any, ABI::Any, ::Any, ::Type, ::Type, ::Type, tt::Any, ::Type, ::Type, ::Type, ::Type, ::Type, ::Any)
@ Enzyme.Compiler ./none:0
[12] (::Core.GeneratedFunctionStub)(::UInt64, ::LineNumberNode, ::Any, ::Vararg{Any})
@ Core ./boot.jl:600
[13] autodiff(::ReverseMode{false, FFIABI}, ::Const{typeof(cart2bary_enzyme)}, ::Type{Const{Nothing}}, ::Const{Matrix{Float64}}, ::Vararg{Any})
@ Enzyme ~/.julia/packages/Enzyme/rbuCz/src/Enzyme.jl:207
[14] autodiff(::ReverseMode{false, FFIABI}, ::Const{typeof(cart2bary_enzyme)}, ::Const{Matrix{Float64}}, ::Const{Matrix{Int64}}, ::Vararg{Any})
@ Enzyme ~/.julia/packages/Enzyme/rbuCz/src/Enzyme.jl:236
[15] autodiff
@ ~/.julia/packages/Enzyme/rbuCz/src/Enzyme.jl:222 [inlined]
[16] main()
@ Main /scratch/raayaiardakani.m/Redbird.jl/test/diff/test_cart2bary.jl:66
[17] top-level scope
@ /scratch/raayaiardakani.m/Redbird.jl/test/diff/test_cart2bary.jl:72
in expression starting at /scratch/raayaiardakani.m/Redbird.jl/test/diff/test_cart2bary.jl:72
@matinraayai is this fixed. I cannot reproduce as your package requires a matlab install I don't have
@matinraayai as this doesn't have a reproducer I can check against am going to close as stale.
Please reopen if it persists.
I'm trying to run the following code which can be found here
When I do that, Enzyme throws the following error in Julia 1.10.0:
The code is part of Redbird.jl and can be run from the high-level folder of the project via
julia --project test/diff/test_cart2bary.jl