julia
julia copied to clipboard
effects: taint `:nothrow` effect on unknown `:static_parameter` (conservatively)
With this commit, we taint :nothrow
effect property correctly on access to unknown :static_parameter
, e.g.:
unknown_sparam_throw(::Union{Nothing, Type{T}}) where T = (T; nothing)
@test Core.Compiler.is_nothrow(Base.infer_effects(unknown_sparam_throw, ((Type{Int},))))
@test !Core.Compiler.is_nothrow(Base.infer_effects(unknown_sparam_throw, ((Nothing,))))
This commit implements a very conservative analysis, and thus there is a room for improvement still, e.g.:
unknown_sparam_nothrow(x::Ref{T}) where {T} = (T; nothing)
@test_broken Core.Compiler.is_nothrow(Base.infer_effects(unknown_sparam_nothrow, (Ref,)))
fix #46771
@Keno is it okay for now to merge this as is, and try to improve the accuracy of this nothrow
analysis in a follow up PR (it seems a bit tricky than I expected though)?
I would prefer to try to get at least some precision in at the same time, because I suspect we're relying on this bug for performance in a number of applications
@aviatesk I rebased this branch, so that we can push forward Keno's PR more easily.
Will this need to be backported to 1.9 since it's a bugfix to the effect system?
Will this need to be backported to 1.9 since it's a bugfix to the effect system?
Yes, I think we should do it.
@nanosoldier runbenchmarks("inference", vs=":master")
Your benchmark job has completed - no performance regressions were detected. A full report can be found here.
given that there aren't any regressions here, good to merge?
There is one test failure on this PR, so don't merge now.
@nanosoldier runbenchmarks("inference", vs=":master")
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.