@@ -1338,27 +1338,6 @@ function info_effects(@nospecialize(result), match::MethodMatch, state::Inlining
1338
1338
end
1339
1339
end
1340
1340
1341
- function compute_joint_effects (info:: Union{ConstCallInfo, Vector{MethodMatchInfo}} , state:: InliningState )
1342
- if isa (info, ConstCallInfo)
1343
- (; call, results) = info
1344
- infos = isa (call, MethodMatchInfo) ? MethodMatchInfo[call] : call. matches
1345
- else
1346
- results = nothing
1347
- infos = info
1348
- end
1349
- local all_result_count = 0
1350
- local joint_effects:: Effects = EFFECTS_TOTAL
1351
- for i in 1 : length (infos)
1352
- meth = infos[i]. results
1353
- for (j, match) in enumerate (meth)
1354
- all_result_count += 1
1355
- result = results === nothing ? nothing : results[all_result_count]
1356
- joint_effects = merge_effects (joint_effects, info_effects (result, match, state))
1357
- end
1358
- end
1359
- return joint_effects
1360
- end
1361
-
1362
1341
function compute_inlining_cases (info:: Union{ConstCallInfo, Vector{MethodMatchInfo}} ,
1363
1342
flag:: UInt8 , sig:: Signature , state:: InliningState )
1364
1343
argtypes = sig. argtypes
@@ -1376,6 +1355,8 @@ function compute_inlining_cases(info::Union{ConstCallInfo, Vector{MethodMatchInf
1376
1355
local only_method = nothing
1377
1356
local meth:: MethodLookupResult
1378
1357
local all_result_count = 0
1358
+ local joint_effects:: Effects = EFFECTS_TOTAL
1359
+ local nothrow:: Bool = true
1379
1360
for i in 1 : length (infos)
1380
1361
meth = infos[i]. results
1381
1362
if meth. ambig
@@ -1400,6 +1381,8 @@ function compute_inlining_cases(info::Union{ConstCallInfo, Vector{MethodMatchInf
1400
1381
for (j, match) in enumerate (meth)
1401
1382
all_result_count += 1
1402
1383
result = results === nothing ? nothing : results[all_result_count]
1384
+ joint_effects = merge_effects (joint_effects, info_effects (result, match, state))
1385
+ nothrow &= match. fully_covers
1403
1386
any_fully_covered |= match. fully_covers
1404
1387
if ! validate_sparams (match. sparams)
1405
1388
if ! match. fully_covers
@@ -1418,6 +1401,8 @@ function compute_inlining_cases(info::Union{ConstCallInfo, Vector{MethodMatchInf
1418
1401
end
1419
1402
end
1420
1403
1404
+ joint_effects = Effects (joint_effects; nothrow)
1405
+
1421
1406
if handled_all_cases && revisit_idx != = nothing
1422
1407
# we handled everything except one match with unmatched sparams,
1423
1408
# so try to handle it by bypassing validate_sparams
@@ -1447,9 +1432,6 @@ function compute_inlining_cases(info::Union{ConstCallInfo, Vector{MethodMatchInf
1447
1432
filter! (case:: InliningCase -> isdispatchtuple (case. sig), cases)
1448
1433
end
1449
1434
1450
- # TODO fuse `compute_joint_effects` into the loop above, which currently causes compilation error
1451
- joint_effects = Effects (compute_joint_effects (info, state); nothrow= handled_all_cases)
1452
-
1453
1435
return cases, (handled_all_cases & any_fully_covered), joint_effects
1454
1436
end
1455
1437
0 commit comments