Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jun 21, 2024
1 parent 727c604 commit 600deb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/absint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ function absint(arg::LLVM.Value, partial::Bool=false)
("jl_box_uint64", UInt64), ("ijl_box_uint64", UInt64),
("jl_box_int32", Int32), ("ijl_box_int32", Int32),
("jl_box_uint32", UInt32), ("ijl_box_uint32", UInt32),
("jl_box_char", Char), ("ijl_box_char", Char),
)
if nm == fname
v = first(operands(arg))
if isa(v, ConstantInt)
return (true, convert(ty, v))
if ty == Char
return (true, Char(convert(Int, v)))
else
return (true, convert(ty, v))
end
end
end
end
Expand Down Expand Up @@ -144,6 +149,7 @@ function abs_typeof(arg::LLVM.Value, partial::Bool=false)::Union{Tuple{Bool, Typ
("jl_box_int32", Int32), ("ijl_box_int32", Int32),
("jl_box_uint32", UInt32), ("ijl_box_uint32", UInt32),
("jl_box_float32", Float32), ("ijl_box_float32", Float32),
("jl_box_char", Char), ("ijl_box_char", Char),
)
if nm == fname
return (true, ty)
Expand Down
3 changes: 2 additions & 1 deletion src/rules/typeunstablerules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ function common_newstructv_fwd(offset, B, orig, gutils, normalR, shadowR)
if !newstruct_common(#=fwd=#true, #=run=#true, offset, B, orig, gutils, normalR, shadowR)
origops = collect(operands(orig))
abs_partial = [abs_typeof(v, true) for v in origops[offset+1:end-1]]
emit_error(B, orig, "Enzyme: Not yet implemented, mixed activity for jl_new_struct constants="*string(icvs)*" "*string(orig)*" "*string(abs)*" "*string([v for v in origops[offset+1:end-1]]))
icvs = [is_constant_value(gutils, v) for v in origops[offset+1:end-1]]
emit_error(B, orig, "Enzyme: Not yet implemented, mixed activity for jl_new_struct constants="*string(icvs)*" "*string(orig)*" "*string(abs_partial)*" "*string([v for v in origops[offset+1:end-1]]))
end

return false
Expand Down

0 comments on commit 600deb0

Please sign in to comment.