Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions base/compiler/ssair/ir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -514,21 +514,21 @@ end
elseif isa(stmt, GotoIfNot)
op == 1 || throw(BoundsError())
stmt = GotoIfNot(v, stmt.dest)
elseif isa(stmt, ReturnNode)
op == 1 || throw(BoundsError())
stmt = ReturnNode(v)
elseif isa(stmt, EnterNode)
op == 1 || throw(BoundsError())
stmt = EnterNode(stmt.catch_dest, v)
Copy link
Member

Choose a reason for hiding this comment

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

This should be stmt.scope now, right (like _useref_getindex)?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not merged yet (#52309). But we probably should keep this handling.

Copy link
Member

Choose a reason for hiding this comment

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

I think #52309 is good to go, so let me just merge that and then this can be rebased and reviewed on top.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, so I guess no changes are required on this part now. This PR does some minor followups on #52309.

elseif isa(stmt, ReturnNode)
op == 1 || throw(BoundsError())
stmt = typeof(stmt)(v)
elseif isa(stmt, Union{AnySSAValue, GlobalRef})
op == 1 || throw(BoundsError())
stmt = v
elseif isa(stmt, UpsilonNode)
op == 1 || throw(BoundsError())
stmt = typeof(stmt)(v)
stmt = UpsilonNode(v)
elseif isa(stmt, PiNode)
op == 1 || throw(BoundsError())
stmt = typeof(stmt)(v, stmt.typ)
stmt = PiNode(v, stmt.typ)
elseif isa(stmt, PhiNode)
op > length(stmt.values) && throw(BoundsError())
isassigned(stmt.values, op) || throw(BoundsError())
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,7 @@ function cfg_simplify!(ir::IRCode)
@assert length(new_bb.succs) <= 2
length(new_bb.succs) <= 1 && continue
if new_bb.succs[1] == new_bb.succs[2]
old_bb2 = findfirst(x::Int->x==bbidx, bb_rename_pred)
old_bb2 = findfirst(x::Int->x==bbidx, bb_rename_pred)::Int
terminator = ir[SSAValue(last(bbs[old_bb2].stmts))]
@assert terminator[:stmt] isa GotoIfNot
# N.B.: The dest will be renamed in process_node! below
Expand Down
2 changes: 1 addition & 1 deletion base/task.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ end
if field === :scope
istaskstarted(t) && error("Setting scope on a started task directly is disallowed.")
end
return @invoke setproperty!(t::Any, field, v)
return @invoke setproperty!(t::Any, field::Symbol, v::Any)
Copy link
Member Author

Choose a reason for hiding this comment

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

v::Any particularly eliminates unnecessary call to Core.Typeof.

end

"""
Expand Down