Skip to content

Commit

Permalink
improve some assertions in base/compiler/ssair/passes.jl (#50547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored Jul 14, 2023
2 parents 7662661 + b9da60f commit ae08077
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ function val_for_def_expr(ir::IRCode, def::Int, fidx::Int)
if isexpr(ex, :new)
return ex.args[1+fidx]
else
@assert isa(ex, Expr)
# The use is whatever the setfield was
@assert is_known_call(ex, setfield!, ir)
return ex.args[4]
end
end
Expand Down Expand Up @@ -939,7 +938,7 @@ function pattern_match_typeof(compact::IncrementalCompact, typ::DataType, fidx::
push!(tvars, applyTvar)
end

applyT.name === typ.name || return false
@assert applyT.name === typ.name
fT = fieldtype(applyT, fidx)
idx = findfirst(IsEgal(fT), tvars)
idx === nothing && return false
Expand Down Expand Up @@ -1106,15 +1105,14 @@ function sroa_pass!(ir::IRCode, inlining::Union{Nothing,InliningState}=nothing)
val = stmt.args[2]
end
struct_typ = widenconst(argextype(val, compact))
struct_typ_name = argument_datatype(struct_typ)
if struct_typ_name === nothing
struct_argtyp = argument_datatype(struct_typ)
if struct_argtyp === nothing
if isa(struct_typ, Union)
lift_comparison!(isdefined, compact, idx, stmt, lifting_cache, 𝕃ₒ)
end
continue
else
struct_typ_name = struct_typ_name.name
end
struct_typ_name = struct_argtyp.name

struct_typ_name.atomicfields == C_NULL || continue # TODO: handle more
if !((field_ordering === :unspecified) ||
Expand Down

2 comments on commit ae08077

@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(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.

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Please sign in to comment.