From 600deb02ad0b3ba19e676d3da61cb50b9f2de451 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Fri, 21 Jun 2024 18:55:06 -0400 Subject: [PATCH] fixup --- src/absint.jl | 8 +++++++- src/rules/typeunstablerules.jl | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/absint.jl b/src/absint.jl index 10dc024013..b3d009c4f0 100644 --- a/src/absint.jl +++ b/src/absint.jl @@ -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 @@ -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) diff --git a/src/rules/typeunstablerules.jl b/src/rules/typeunstablerules.jl index 2878484d21..6ba60d3b3e 100644 --- a/src/rules/typeunstablerules.jl +++ b/src/rules/typeunstablerules.jl @@ -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