@@ -1281,6 +1281,8 @@ function handle_const_call!(
12811281 push! (cases, InliningCase (result. mi. specTypes, case))
12821282 elseif isa (result, InferenceResult)
12831283 handled_all_cases &= handle_inf_result! (result, argtypes, flag, state, cases)
1284+ elseif isa (result, SemiConcreteResult)
1285+ handled_all_cases &= handle_semi_concrete_result! (result, cases)
12841286 else
12851287 @assert result === nothing
12861288 handled_all_cases &= handle_match! (match, argtypes, flag, state, cases)
@@ -1294,8 +1296,13 @@ function handle_const_call!(
12941296 if length (cases) == 0
12951297 length (results) == 1 || return nothing
12961298 result = results[1 ]
1297- isa (result, InferenceResult) || return nothing
1298- handle_inf_result! (result, argtypes, flag, state, cases, true ) || return nothing
1299+ if isa (result, InferenceResult)
1300+ handle_inf_result! (result, argtypes, flag, state, cases, true ) || return nothing
1301+ elseif isa (result, SemiConcreteResult)
1302+ handle_semi_concrete_result! (result, cases) || return nothing
1303+ else
1304+ return nothing
1305+ end
12991306 spec_types = cases[1 ]. sig
13001307 any_covers_full = handled_all_cases = atype <: spec_types
13011308 end
@@ -1328,6 +1335,15 @@ function handle_inf_result!(
13281335 return true
13291336end
13301337
1338+ function handle_semi_concrete_result! (result:: SemiConcreteResult , cases:: Vector{InliningCase} , allow_abstract:: Bool = false )
1339+ mi = result. mi
1340+ spec_types = mi. specTypes
1341+ allow_abstract || isdispatchtuple (spec_types) || return false
1342+ validate_sparams (mi. sparam_vals) || return false
1343+ push! (cases, InliningCase (spec_types, InliningTodo (mi, result. ir, result. effects)))
1344+ return true
1345+ end
1346+
13311347function const_result_item (result:: ConstResult , state:: InliningState )
13321348 if ! isdefined (result, :result ) || ! is_inlineable_constant (result. result)
13331349 return compileable_specialization (state. et, result. mi, EFFECTS_TOTAL)
0 commit comments