Skip to content

Commit

Permalink
rough fix to allow at-pure optimization for generated thunks that hav…
Browse files Browse the repository at this point in the history
…e the pure field set
  • Loading branch information
jrevels committed Feb 8, 2019
1 parent a0bb006 commit 466b84e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,16 @@ function pure_eval_call(@nospecialize(f), argtypes::Vector{Any}, @nospecialize(a
return false
end
meth = meth[1]::SimpleVector
sig = meth[1]::DataType
sparams = meth[2]::SimpleVector
method = meth[3]::Method
# TODO: check pure on the inferred thunk
if isdefined(method, :generator) || !method.pure

if isdefined(method, :generator)
method.generator.expand_early || return false
mi = code_for_method(method, sig, sparams, sv.params.world, false)
isa(mi, MethodInstance) || return false
get_staged(mi).pure || return false
elseif !method.pure
return false
end

Expand Down

0 comments on commit 466b84e

Please sign in to comment.