Skip to content

Commit 0f59633

Browse files
committed
inlining: Use tfunc for inserted isa/and calls
The motivation for this is the same as #54105, where the return types being filled in by inference can in general be imprecise when running the compiler with an extended lattice. This PR is very incomplete - There are at least 6+ more places in `inlining.jl` where we hard-code return types that will need similar treatment.
1 parent b24156b commit 0f59633

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

base/compiler/ssair/inlining.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,14 @@ function ir_inline_unionsplit!(compact::IncrementalCompact, idx::Int, argexprs::
545545
aft <: mft && continue
546546
# Generate isa check
547547
isa_expr = Expr(:call, isa, argexprs[i], mft)
548-
ssa = insert_node_here!(compact, NewInstruction(isa_expr, Bool, line))
548+
isa_type = isa_tfunc(optimizer_lattice(interp), argextype(argexprs[i], compact), Const(mft))
549+
ssa = insert_node_here!(compact, NewInstruction(isa_expr, isa_type, line))
549550
if cond === true
550551
cond = ssa
551552
else
552553
and_expr = Expr(:call, and_int, cond, ssa)
553-
cond = insert_node_here!(compact, NewInstruction(and_expr, Bool, line))
554+
and_type = and_int_tfunc(optimizer_lattice(interp), argextype(cond, compact), isa_type)
555+
cond = insert_node_here!(compact, NewInstruction(and_expr, and_type, line))
554556
end
555557
end
556558
insert_node_here!(compact, NewInstruction(GotoIfNot(cond, next_cond_bb), Union{}, line))

0 commit comments

Comments
 (0)