Skip to content

Commit

Permalink
follow up #43565 (#43755)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk authored Jan 11, 2022
1 parent 6b272af commit b59e852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
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) \

0 comments on commit b59e852

Please sign in to comment.