@@ -734,7 +734,7 @@ function enzyme_custom_common_rev(forward::Bool, B, orig::LLVM.CallInst, gutils,
734734 end
735735 end
736736
737- # push!(function_attributes(llvmf), EnumAttribute("alwaysinline", 0))
737+ push! (function_attributes (llvmf), EnumAttribute (" alwaysinline" , 0 ))
738738
739739 needsTape = ! isghostty (TapeT) && ! Core. Compiler. isconstType (TapeT)
740740
@@ -765,11 +765,11 @@ function enzyme_custom_common_rev(forward::Bool, B, orig::LLVM.CallInst, gutils,
765765 funcTy = rev_TT. parameters[isKWCall ? 4 : 2 ]
766766 if needsTape
767767 @assert tape != C_NULL
768- tape_idx = 1 + (kwtup!= = nothing && ! isghostty (kwtup))+ (isKWCall && ! isghostty (rev_TT . parameters[ 4 ])) + ! isghostty (funcTy)
769- trueidx = tape_idx+ (sret != = nothing )+ (returnRoots != = nothing )+ swiftself+ (RT <: Active )
768+ tape_idx = 1 + (kwtup!= = nothing && ! isghostty (kwtup)) + ! isghostty (funcTy)
769+ trueidx = tape_idx+ (sret != = nothing )+ (returnRoots != = nothing )+ swiftself + (RT <: Active )
770770 innerTy = value_type (parameters (llvmf)[trueidx])
771771 if innerTy != value_type (tape)
772- if isabstracttype (TapeT) || TapeT == Tuple || TapeT. layout == C_NULL
772+ if isabstracttype (TapeT) || TapeT == Tuple || TapeT. layout == C_NULL || TapeT == Array
773773 msg = sprint () do io
774774 println (io, " Enzyme : mismatch between innerTy $innerTy and tape type $(value_type (tape)) " )
775775 println (io, " tape_idx=" , tape_idx)
@@ -831,7 +831,7 @@ function enzyme_custom_common_rev(forward::Bool, B, orig::LLVM.CallInst, gutils,
831831 if any_jltypes (llty)
832832 emit_writebarrier! (B, get_julia_inner_types (B, al0, val))
833833 end
834- insert! (args, 1 + (! isghostty (funcTy))+ (kwtup!= = nothing && ! isghostty (kwtup))+ (isKWCall && ! isghostty (rev_TT . parameters[ 4 ])) , al)
834+ insert! (args, 1 + (! isghostty (funcTy))+ (kwtup!= = nothing && ! isghostty (kwtup)), al)
835835 end
836836 end
837837
0 commit comments