EnzymeAD / Enzyme.jl

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

Cannot deduce type after recent commit #784

Closed jgreener64 closed 1 year ago

jgreener64 commented 1 year ago

I am on Julia 1.8.5 and StaticArrays 1.5.19. It looks like the commit db6324c04daa52b33c6290fb7e30a5685369071d made the following code, which doesn't do anything but is minimised from a larger block that does, give an error:

using Enzyme, StaticArrays

function f(x, n)
    temp = [zero(x) for _ in 1:n]
    return nothing
end

x = rand(SVector{3, Float64}, 10)
dx = zero(x)

grads = autodiff(
    Reverse,
    f,
    Const,
    Duplicated(x, dx),
    Const(1),
)

It works if the temp = [zero(x) for _ in 1:n] line is commented out, and if x = rand(10) rather than static arrays. The truncated error is:

ERROR: LoadError: Enzyme cannot deduce type
Current scope: 
; Function Attrs: mustprogress willreturn
define internal fastcc nonnull {} addrspace(10)* @preprocess_julia_collect_3449({ [1 x {} addrspace(10)*], [2 x i64] } addrspace(11)* nocapture noundef nonnull readonly align 8 dereferenceable(24) %0) unnamed_addr #10 !dbg !221 {
top:
  %1 = call {}*** @julia.get_pgcstack() #11
  %2 = getelementptr inbounds { [1 x {} addrspace(10)*], [2 x i64] }, { [1 x {} addrspace(10)*], [2 x i64] } addrspace(11)* %0, i64 0, i32 1, i64 0, !dbg !222
  %3 = getelementptr inbounds { [1 x {} addrspace(10)*], [2 x i64] }, { [1 x {} addrspace(10)*], [2 x i64] } addrspace(11)* %0, i64 0, i32 1, i64 1, !dbg !229
  %4 = load i64, i64 addrspace(11)* %3, align 8, !dbg !231, !tbaa !25, !invariant.load !4
  %5 = load i64, i64 addrspace(11)* %2, align 8, !dbg !231
  %6 = sub i64 %4, %5, !dbg !231
  %7 = add i64 %6, 1, !dbg !233
  %8 = icmp sgt i64 %7, 0, !dbg !234
  %9 = select i1 %8, i64 %7, i64 0, !dbg !234
  %10 = getelementptr inbounds { [1 x {} addrspace(10)*], [2 x i64] }, { [1 x {} addrspace(10)*], [2 x i64] } addrspace(11)* %0, i64 0, i32 1, !dbg !239
  %.not = icmp slt i64 %4, %5, !dbg !242
  %.not16 = icmp eq [2 x i64] addrspace(11)* %10, null, !dbg !245
  %11 = select i1 %.not, i1 true, i1 %.not16, !dbg !245
  %value_phi1 = select i1 %11, i64 undef, i64 %5, !dbg !245
  br i1 %.not, label %L67, label %L26, !dbg !246

L26:                                              ; preds = %top
  %12 = bitcast { [1 x {} addrspace(10)*], [2 x i64] } addrspace(11)* %0 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* addrspace(11)*, !dbg !247
  %13 = load atomic { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* addrspace(11)* %12 unordered, align 8, !dbg !247, !tbaa !25, !invariant.load !4, !nonnull !4, !dereferenceable !30, !align !31
  %14 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %13 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !249
  %15 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %14, i64 0, i32 1, !dbg !249
  %16 = load i64, i64 addrspace(11)* %15, align 8, !dbg !249, !tbaa !43, !range !46
  %17 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140209526466656 to {}*) to {} addrspace(10)*), i64 %16) #11, !dbg !252
  %18 = bitcast {} addrspace(10)* %17 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !253
  %19 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %18 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !253
  %20 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %19, i64 0, i32 1, !dbg !253
  %21 = load i64, i64 addrspace(11)* %20, align 8, !dbg !253, !tbaa !43, !range !46
  %.not18.not = icmp eq i64 %21, 0, !dbg !258
  br i1 %.not18.not, label %L69, label %L44.preheader, !dbg !257

L44.preheader:                                    ; preds = %L26
  %22 = bitcast {} addrspace(10)* %17 to [1 x [3 x double]] addrspace(13)* addrspace(10)*
  %23 = addrspacecast [1 x [3 x double]] addrspace(13)* addrspace(10)* %22 to [1 x [3 x double]] addrspace(13)* addrspace(11)*
  %24 = add nsw i64 %21, -1, !dbg !262
  %xtraiter = and i64 %21, 7, !dbg !262
  %25 = icmp ult i64 %24, 7, !dbg !262
  br i1 %25, label %L69.loopexit.unr-lcssa, label %L44.preheader.new, !dbg !262

L44.preheader.new:                                ; preds = %L44.preheader
  %unroll_iter = and i64 %21, 9223372036854775800, !dbg !262
  br label %L44, !dbg !262

L44:                                              ; preds = %L44, %L44.preheader.new
  %iv = phi i64 [ %iv.next, %L44 ], [ 0, %L44.preheader.new ]
  %26 = mul i64 %iv, -8, !dbg !263
  %iv.next = add nuw nsw i64 %iv, 1, !dbg !263
  %27 = add i64 %unroll_iter, %26, !dbg !263
  %28 = shl i64 %iv, 3, !dbg !263
  %29 = add i64 %28, 1, !dbg !263
  %30 = add nsw i64 %29, -1, !dbg !263
  %31 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %32 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %31, i64 %30, !dbg !263
  %33 = bitcast [1 x [3 x double]] addrspace(13)* %32 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %33, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %34 = add nuw nsw i64 %29, 1, !dbg !268
  %35 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %36 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %35, i64 %29, !dbg !263
  %37 = bitcast [1 x [3 x double]] addrspace(13)* %36 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %37, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %38 = add nuw nsw i64 %29, 2, !dbg !268
  %39 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %40 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %39, i64 %34, !dbg !263
  %41 = bitcast [1 x [3 x double]] addrspace(13)* %40 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %41, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %42 = add nuw nsw i64 %29, 3, !dbg !268
  %43 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %44 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %43, i64 %38, !dbg !263
  %45 = bitcast [1 x [3 x double]] addrspace(13)* %44 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %45, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %46 = add nuw nsw i64 %29, 4, !dbg !268
  %47 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %48 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %47, i64 %42, !dbg !263
  %49 = bitcast [1 x [3 x double]] addrspace(13)* %48 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %49, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %50 = add nuw nsw i64 %29, 5, !dbg !268
  %51 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %52 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %51, i64 %46, !dbg !263
  %53 = bitcast [1 x [3 x double]] addrspace(13)* %52 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %53, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %54 = add nuw nsw i64 %29, 6, !dbg !268
  %55 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %56 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %55, i64 %50, !dbg !263
  %57 = bitcast [1 x [3 x double]] addrspace(13)* %56 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %57, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %58 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %59 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %58, i64 %54, !dbg !263
  %60 = bitcast [1 x [3 x double]] addrspace(13)* %59 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %60, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %61 = add nuw nsw i64 %29, 8, !dbg !268
  %niter.nsub.7 = add i64 %27, -8, !dbg !262
  %niter.ncmp.7 = icmp eq i64 %niter.nsub.7, 0, !dbg !262
  br i1 %niter.ncmp.7, label %L69.loopexit.unr-lcssa.loopexit, label %L44, !dbg !262

common.ret:                                       ; preds = %merge_own, %L67
  %common.ret.op = phi {} addrspace(10)* [ %62, %L67 ], [ %90, %merge_own ]
  ret {} addrspace(10)* undef, !dbg !269

L67:                                              ; preds = %top
  %62 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140202568605200 to {}*) to {} addrspace(10)*), i64 %9) #11, !dbg !270
  br label %common.ret

L69.loopexit.unr-lcssa.loopexit:                  ; preds = %L44
  br label %L69.loopexit.unr-lcssa, !dbg !262

L69.loopexit.unr-lcssa:                           ; preds = %L69.loopexit.unr-lcssa.loopexit, %L44.preheader
  %value_phi8.unr = phi i64 [ 1, %L44.preheader ], [ %61, %L69.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0, !dbg !262
  br i1 %lcmp.mod.not, label %L69, label %L44.epil.preheader, !dbg !262

L44.epil.preheader:                               ; preds = %L69.loopexit.unr-lcssa
  br label %L44.epil, !dbg !262

L44.epil:                                         ; preds = %L44.epil.preheader, %L44.epil
  %iv1 = phi i64 [ 0, %L44.epil.preheader ], [ %iv.next2, %L44.epil ]
  %63 = mul nsw i64 %iv1, -1, !dbg !263
  %iv.next2 = add nuw nsw i64 %iv1, 1, !dbg !263
  %64 = add i64 %xtraiter, %63, !dbg !263
  %65 = add i64 %value_phi8.unr, %iv1, !dbg !263
  %66 = add nsw i64 %65, -1, !dbg !263
  %67 = load [1 x [3 x double]] addrspace(13)*, [1 x [3 x double]] addrspace(13)* addrspace(11)* %23, align 8, !dbg !263, !tbaa !72, !alias.scope !265, !nonnull !4
  %68 = getelementptr inbounds [1 x [3 x double]], [1 x [3 x double]] addrspace(13)* %67, i64 %66, !dbg !263
  %69 = bitcast [1 x [3 x double]] addrspace(13)* %68 to i8 addrspace(13)*, !dbg !263
  call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %69, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !263
  %70 = add nuw nsw i64 %65, 1, !dbg !268
  %epil.iter.sub = add nsw i64 %64, -1, !dbg !262
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.sub, 0, !dbg !262
  br i1 %epil.iter.cmp.not, label %L69.loopexit, label %L44.epil, !dbg !262, !llvm.loop !276

L69.loopexit:                                     ; preds = %L44.epil
  br label %L69, !dbg !277

L69:                                              ; preds = %L69.loopexit, %L69.loopexit.unr-lcssa, %L26
  %71 = call noalias nonnull {} addrspace(10)* @ijl_alloc_array_1d({} addrspace(10)* noundef addrspacecast ({}* inttoptr (i64 140202568605200 to {}*) to {} addrspace(10)*), i64 %9) #11, !dbg !277
  %72 = bitcast {} addrspace(10)* %71 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, !dbg !283
  %73 = addrspacecast { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* %72 to { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)*, !dbg !283
  %74 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %73, i64 0, i32 1, !dbg !283
  %75 = load i64, i64 addrspace(11)* %74, align 8, !dbg !283, !tbaa !43, !range !46
  %.not17 = icmp eq i64 %75, 0, !dbg !283
  br i1 %.not17, label %oob, label %idxend, !dbg !283

oob:                                              ; preds = %L69
  %76 = alloca i64, align 8, !dbg !283
  store i64 1, i64* %76, align 8, !dbg !283, !noalias !265
  %77 = addrspacecast {} addrspace(10)* %71 to {} addrspace(12)*, !dbg !283
  call void @ijl_bounds_error_ints({} addrspace(12)* nonnull %77, i64* noundef nonnull align 8 %76, i64 noundef 1) #12, !dbg !283
  unreachable, !dbg !283

idxend:                                           ; preds = %L69
  %78 = getelementptr inbounds { i8 addrspace(13)*, i64, i16, i16, i32 }, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(11)* %73, i64 0, i32 2, !dbg !283
  %79 = load i16, i16 addrspace(11)* %78, align 2, !dbg !283, !tbaa !82
  %80 = and i16 %79, 3, !dbg !283
  %81 = icmp eq i16 %80, 3, !dbg !283
  br i1 %81, label %array_owned, label %merge_own, !dbg !283

array_owned:                                      ; preds = %idxend
  %82 = bitcast {} addrspace(10)* %71 to {} addrspace(10)* addrspace(10)*, !dbg !283
  %83 = addrspacecast {} addrspace(10)* addrspace(10)* %82 to {} addrspace(10)* addrspace(11)*, !dbg !283
  %84 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %83, i64 5, !dbg !283
  %85 = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %84, align 8, !dbg !283, !tbaa !25, !invariant.load !4, !nonnull !4, !dereferenceable !30, !align !31
  br label %merge_own, !dbg !283

merge_own:                                        ; preds = %array_owned, %idxend
  %86 = phi {} addrspace(10)* [ %71, %idxend ], [ %85, %array_owned ], !dbg !283
  %87 = bitcast {} addrspace(10)* %71 to {} addrspace(10)* addrspace(13)* addrspace(10)*, !dbg !283
  %88 = addrspacecast {} addrspace(10)* addrspace(13)* addrspace(10)* %87 to {} addrspace(10)* addrspace(13)* addrspace(11)*, !dbg !283
  %89 = load {} addrspace(10)* addrspace(13)*, {} addrspace(10)* addrspace(13)* addrspace(11)* %88, align 8, !dbg !283, !tbaa !72, !alias.scope !265, !nonnull !4
  store atomic {} addrspace(10)* %17, {} addrspace(10)* addrspace(13)* %89 unordered, align 8, !dbg !283, !tbaa !85, !noalias !265
  call void ({} addrspace(10)*, ...) @julia.write_barrier({} addrspace(10)* nonnull %86, {} addrspace(10)* nonnull %17) #13, !dbg !283
  %90 = call fastcc nonnull {} addrspace(10)* @julia_collect_to__3452({} addrspace(10)* noundef nonnull align 16 dereferenceable(40) %71, { [1 x {} addrspace(10)*], [2 x i64] } addrspace(11)* nocapture nofree noundef nonnull readonly align 8 dereferenceable(24) %0, i64 signext %value_phi1) #14, !dbg !286
  br label %common.ret
}

 Type analysis state: 
<analysis>
{} addrspace(10)* addrspacecast ({}* inttoptr (i64 140209526466656 to {}*) to {} addrspace(10)*): {[-1]:Anything}, intvals: {}
i64 undef: {[-1]:Anything}, intvals: {}
i64 8: {[-1]:Integer}, intvals: {8,}
i64 3: {[-1]:Integer}, intvals: {3,}
i64 -1: {[-1]:Anything}, intvals: {-1,}
i64 7: {[-1]:Integer}, intvals: {7,}
i64 9223372036854775800: {[-1]:Anything}, intvals: {9223372036854775800,}
i64 -8: {[-1]:Integer}, intvals: {-8,}
i64 2: {[-1]:Integer}, intvals: {2,}
i64 0: {[-1]:Anything}, intvals: {0,}
i64 1: {[-1]:Integer}, intvals: {1,}
{} addrspace(10)* undef: {[-1]:Anything}, intvals: {}
i64 6: {[-1]:Integer}, intvals: {6,}
i64 4: {[-1]:Integer}, intvals: {4,}
i64 5: {[-1]:Integer}, intvals: {5,}

[...]

{} addrspace(10)* addrspacecast ({}* inttoptr (i64 140202568605200 to {}*) to {} addrspace(10)*): {[-1]:Anything}, intvals: {}
{}* inttoptr (i64 140209526466656 to {}*): {[-1]:Anything}, intvals: {}
  %13 = load atomic { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)*, { i8 addrspace(13)*, i64, i16, i16, i32 } addrspace(10)* addrspace(11)* %12 unordered, align 8, !dbg !64, !tbaa !33, !invariant.load !4, !nonnull !4, !dereferenceable !68, !align !69: {[-1]:Pointer, [-1,0]:Pointer, [-1,0,0]:Float@double, [-1,0,8]:Float@double, [-1,0,16]:Float@double, [-1,8]:Integer, [-1,9]:Integer, [-1,10]:Integer, [-1,11]:Integer, [-1,12]:Integer, [-1,13]:Integer, [-1,14]:Integer, [-1,15]:Integer, [-1,16]:Integer, [-1,17]:Integer, [-1,18]:Integer, [-1,19]:Integer, [-1,20]:Integer, [-1,21]:Integer, [-1,22]:Integer, [-1,23]:Integer, [-1,24]:Integer, [-1,25]:Integer, [-1,26]:Integer, [-1,27]:Integer, [-1,28]:Integer, [-1,29]:Integer, [-1,30]:Integer, [-1,31]:Integer, [-1,32]:Integer, [-1,33]:Integer, [-1,34]:Integer, [-1,35]:Integer, [-1,36]:Integer, [-1,37]:Integer, [-1,38]:Integer, [-1,39]:Integer, [-1,40]:Integer}, intvals: {}
  %27 = add i64 %unroll_iter, %26, !dbg !98: {[-1]:Integer}, intvals: {}
  %iv.next2 = add nuw nsw i64 %iv1, 1, !dbg !98: {[-1]:Integer}, intvals: {1,}
  %65 = add i64 %value_phi8.unr, %iv1, !dbg !98: {[-1]:Integer}, intvals: {1,9,}
</analysis>

Cannot deduce type of memset   call void @llvm.memset.p13i8.i64(i8 addrspace(13)* noundef align 8 dereferenceable(24) %60, i8 noundef 0, i64 noundef 24, i1 noundef false) #11, !dbg !98

Caused by:
Stacktrace:
 [1] setindex!
   @ ./array.jl:966
 [2] fill!
   @ ./array.jl:353
 [3] zero
   @ ./abstractarray.jl:1156
 [4] #1
   @ ./none:0
 [5] iterate
   @ ./generator.jl:47
 [6] collect
   @ ./array.jl:787

Stacktrace:
  [1] julia_error(cstr::Cstring, val::Ptr{LLVM.API.LLVMOpaqueValue}, errtype::Enzyme.API.ErrorType, data::Ptr{Nothing})
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:5330
  [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/dev/Enzyme/src/api.jl:124
  [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::Tuple{Bool, Bool, Bool}, returnPrimal::Bool, jlrules::Vector{String}, expectedTapeType::Type)
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:6921
  [4] codegen(output::Symbol, job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, ctx::LLVM.Context, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:8171
  [5] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, ctx::Nothing, postopt::Bool)
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:8684
  [6] _thunk
    @ ~/.julia/dev/Enzyme/src/compiler.jl:8681 [inlined]
  [7] cached_compilation
    @ ~/.julia/dev/Enzyme/src/compiler.jl:8719 [inlined]
  [8] #s263#191
    @ ~/.julia/dev/Enzyme/src/compiler.jl:8777 [inlined]
  [9] var"#s263#191"(FA::Any, A::Any, TT::Any, Mode::Any, ModifiedBetween::Any, width::Any, ReturnPrimal::Any, ShadowInit::Any, World::Any, ::Any, ::Any, ::Any, ::Any, tt::Any, ::Any, ::Any, ::Any, ::Any, ::Any)
    @ Enzyme.Compiler ./none:0
 [10] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any})
    @ Core ./boot.jl:582
 [11] thunk(::Val{0x0000000000007ed8}, ::Type{Const{typeof(f)}}, ::Type{Const}, tt::Type{Tuple{Duplicated{Vector{SVector{3, Float64}}}, Const{Int64}}}, ::Val{Enzyme.API.DEM_ReverseModeCombined}, ::Val{1}, ::Val{(false, false, false)}, ::Val{false})
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:8736
 [12] autodiff(::EnzymeCore.ReverseMode{false}, ::Const{typeof(f)}, ::Type{Const}, ::Duplicated{Vector{SVector{3, Float64}}}, ::Vararg{Any})
    @ Enzyme ~/.julia/dev/Enzyme/src/Enzyme.jl:199
 [13] autodiff(::EnzymeCore.ReverseMode{false}, ::typeof(f), ::Type, ::Duplicated{Vector{SVector{3, Float64}}}, ::Vararg{Any})
    @ Enzyme ~/.julia/dev/Enzyme/src/Enzyme.jl:214
 [14] top-level scope
    @ ~/dms/molly_dev/enzyme_err24.jl:14
in expression starting at /home/jgreener/dms/molly_dev/enzyme_err24.jl:14
wsmoses commented 1 year ago

Can you paste the whole type analysis state, untruncated?

jgreener64 commented 1 year ago

The whole error is attached as error.txt, this is with d6e691c.

wsmoses commented 1 year ago

This should be fixed by https://github.com/EnzymeAD/Enzyme.jl/pull/792 lmk if not.

jgreener64 commented 1 year ago

That fixes it, thanks.