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

remove :boundscheck argument from Core._svec_ref #50561

Merged
merged 1 commit into from
Jul 17, 2023
Merged

remove :boundscheck argument from Core._svec_ref #50561

merged 1 commit into from
Jul 17, 2023

Conversation

aviatesk
Copy link
Sponsor Member

Core._svec_ref has accepted boundscheck-value as the first argument since it was added in #45062. Nonetheless, Core._svec_ref simply calls jl_svec_ref in either the interpreter or the codegen, and thus the boundscheck value isn't utilized in any optimizations. Rather, even worse, this boundscheck-argument negatively influences the effect analysis (xref #50167 for details) and has caused type inference regressions as reported in #50544.

For these reasons, this commit simply eliminates the boundscheck argument from Core._svec_ref. Consequently,
getindex(::SimpleVector, ::Int) is now being concrete-eval eligible.

closes #50544

`Core._svec_ref` has accepted `boundscheck`-value as the first argument
since it was added in #45062. Nonetheless, `Core._svec_ref` simply calls
`jl_svec_ref` in either the interpreter or the codegen, and thus the
`boundscheck` value isn't utilized in any optimizations. Rather, even
worse, this `boundscheck`-argument negatively influences the effect
analysis (xref #50167 for details) and has caused type inference
regressions as reported in #50544.

For these reasons, this commit simply eliminates the `boundscheck`
argument from `Core._svec_ref`. Consequently,
`getindex(::SimpleVector, ::Int)` is now being concrete-eval eligible.

closes #50544
Copy link
Sponsor Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised inference and codegen don't have any opinion about this

@KristofferC KristofferC added the backport 1.10 Change should be backported to the 1.10 release label Jul 16, 2023
@aviatesk
Copy link
Sponsor Member Author

Core._svec_ref is a special built-in that was added as a target for pattern matching in #45062, thus it appears to have only the most basic implementation. So it doesn't even possess tfunc.

@aviatesk aviatesk merged commit 1964621 into master Jul 17, 2023
7 checks passed
@aviatesk aviatesk deleted the avi/50544 branch July 17, 2023 03:46
aviatesk added a commit that referenced this pull request Jul 17, 2023
`Core._svec_ref` has accepted `boundscheck`-value as the first argument
since it was added in #45062. Nonetheless, `Core._svec_ref` simply calls
`jl_svec_ref` in either the interpreter or the codegen, and thus the
`boundscheck` value isn't utilized in any optimizations. Rather, even
worse, this `boundscheck`-argument negatively influences the effect
analysis (xref #50167 for details) and has caused type inference
regressions as reported in #50544.

For these reasons, this commit simply eliminates the `boundscheck`
argument from `Core._svec_ref`. Consequently,
`getindex(::SimpleVector, ::Int)` is now being concrete-eval eligible.

closes #50544
@aviatesk aviatesk removed the backport 1.10 Change should be backported to the 1.10 release label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

type inference regression in 1.10.0-alpha1 when using @propagate_inbounds
4 participants