Skip to content

Commit

Permalink
optimizer: minor refactor on ir_inline_unionsplit! (#44482)
Browse files Browse the repository at this point in the history
Suggested at: <#44445 (comment)>
  • Loading branch information
aviatesk authored Mar 7, 2022
1 parent 9a48dc1 commit 811e534
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -474,16 +474,16 @@ function ir_inline_unionsplit!(compact::IncrementalCompact, idx::Int,
@assert length(bbs) >= length(cases)
for i in 1:length(cases)
ithcase = cases[i]
metharg = ithcase.sig::DataType # checked within `handle_cases!`
mtype = ithcase.sig::DataType # checked within `handle_cases!`
case = ithcase.item
next_cond_bb = bbs[i]
cond = true
aparams, mparams = atype.parameters, metharg.parameters
@assert length(aparams) == length(mparams)
nparams = fieldcount(atype)
@assert nparams == fieldcount(mtype)
if i != length(cases) || !fully_covered ||
(!params.trust_inference && isdispatchtuple(cases[i].sig))
for i in 1:length(aparams)
a, m = aparams[i], mparams[i]
for i = 1:nparams
a, m = fieldtype(atype, i), fieldtype(mtype, i)
# If this is always true, we don't need to check for it
a <: m && continue
# Generate isa check
Expand All @@ -503,10 +503,10 @@ function ir_inline_unionsplit!(compact::IncrementalCompact, idx::Int,
argexprs′ = argexprs
if !isa(case, ConstantCase)
argexprs′ = copy(argexprs)
for i = 1:length(mparams)
for i = 1:nparams
argex = argexprs[i]
(isa(argex, SSAValue) || isa(argex, Argument)) || continue
a, m = aparams[i], mparams[i]
a, m = fieldtype(atype, i), fieldtype(mtype, i)
if !(a <: m)
argexprs′[i] = insert_node_here!(compact,
NewInstruction(PiNode(argex, m), m, line))
Expand Down

2 comments on commit 811e534

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.