Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adce_pass: Drop phinode edges that can be proved unused #43922

Merged
merged 6 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Shuhei Kadowaki <[email protected]>
  • Loading branch information
Keno and aviatesk committed Jan 25, 2022
commit d556dd60746cb59ceac9877afe17de666f8c2c6d
2 changes: 1 addition & 1 deletion base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ function adce_pass!(ir::IRCode)
if !isassigned(stmt.values, i)
# Should be impossible to have something used only by PiNodes that's undef
push!(to_drop, i)
elseif typeintersect(widenconst(argextype(stmt.values[i], compact)), t) === Union{}
elseif !hasintersect(widenconst(argextype(stmt.values[i], compact)), t)
push!(to_drop, i)
end
end
Expand Down
4 changes: 1 addition & 3 deletions test/compiler/irpasses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,6 @@ let
dispatch(a)
end
let src = code_typed(foo, Tuple{Bool})[1][1]
@test !any(src.code) do stmt
isa(stmt, Expr) && stmt.head === :call && stmt.args[1] === Core.tuple
end
@test count(iscall((src, Core.tuple)), src.code) == 0
end
end