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

follow up #43565 #43755

Merged
merged 1 commit into from
Jan 11, 2022
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
12 changes: 4 additions & 8 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function stmt_effect_free(@nospecialize(stmt), @nospecialize(rt), src::Union{IRC
end
return true
elseif head === :foreigncall
return foreigncall_effect_free(stmt, rt, src)
return foreigncall_effect_free(stmt, src)
elseif head === :new_opaque_closure
length(args) < 5 && return false
typ = argextype(args[1], src)
Expand All @@ -262,7 +262,7 @@ function stmt_effect_free(@nospecialize(stmt), @nospecialize(rt), src::Union{IRC
return true
end

function foreigncall_effect_free(stmt::Expr, @nospecialize(rt), src::Union{IRCode,IncrementalCompact})
function foreigncall_effect_free(stmt::Expr, src::Union{IRCode,IncrementalCompact})
args = stmt.args
name = args[1]
isa(name, QuoteNode) && (name = name.value)
Expand Down Expand Up @@ -293,9 +293,7 @@ end

function alloc_array_no_throw(args::Vector{Any}, ndims::Int, src::Union{IRCode,IncrementalCompact})
length(args) ≥ ndims+6 || return false
atype = widenconst(argextype(args[6], src))
isType(atype) || return false
atype = atype.parameters[1]
atype = instanceof_tfunc(argextype(args[6], src))[1]
dims = Csize_t[]
for i in 1:ndims
dim = argextype(args[i+6], src)
Expand All @@ -309,9 +307,7 @@ end

function new_array_no_throw(args::Vector{Any}, src::Union{IRCode,IncrementalCompact})
length(args) ≥ 7 || return false
atype = widenconst(argextype(args[6], src))
isType(atype) || return false
atype = atype.parameters[1]
atype = instanceof_tfunc(argextype(args[6], src))[1]
dims = argextype(args[7], src)
isa(dims, Const) || return dims === Tuple{}
dimsval = dims.val
Expand Down
1 change: 1 addition & 0 deletions src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -567,3 +567,4 @@
YY(LLVMExtraAddGCInvariantVerifierPass) \
YY(LLVMExtraAddDemoteFloat16Pass) \
YY(LLVMExtraAddCPUFeaturesPass) \