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

Stop setting force_noinline for functions of union arguments #27057

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

Keno
Copy link
Member

@Keno Keno commented May 10, 2018

The original motivation for setting force_noinline for functions
with union arguments seems to have been bugs in type intersection.
However, the type system has improved quite a bit and at least in
the test suites we don't seem to run into any issues. Thus, we can
stop setting force_noinline. Nevertheless, it still make since
to penalize functions with union arguments. Doing so encourages
union splits to happen at the call site, rather than having multiple
redundant union splits inside the function. However, for simple functions
of intrinsics and builtins it can make a lot of sense to inline
the union split signature.

@Keno Keno requested review from vtjnash and JeffBezanson May 10, 2018 02:31
@Keno
Copy link
Member Author

Keno commented May 10, 2018

@nanosoldier runbenchmarks(ALL, vs = ":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@vtjnash
Copy link
Member

vtjnash commented Aug 7, 2018

Didn't something like this get merged?

@vtjnash vtjnash closed this Mar 5, 2019
@Keno
Copy link
Member Author

Keno commented Mar 5, 2019

Did this actually get merged? I don't remember that happening.

@vtjnash
Copy link
Member

vtjnash commented Mar 5, 2019

oh, apparently not. why do we have that check in there?

@vtjnash vtjnash reopened this Mar 5, 2019
@vtjnash
Copy link
Member

vtjnash commented Aug 5, 2019

bump

1 similar comment
@vtjnash
Copy link
Member

vtjnash commented Feb 24, 2020

bump

@vtjnash
Copy link
Member

vtjnash commented Sep 3, 2020

bump?

@Keno Keno force-pushed the kf/unionpenalties branch 2 times, most recently from 89afe85 to 009ffe2 Compare September 4, 2020 16:04
The original motivation for setting force_noinline for functions
with union arguments seems to have been bugs in type intersection.
However, the type system has improved quite a bit and at least in
the test suites we don't seem to run into any issues. Thus, we can
stop setting force_noinline. Nevertheless, it still make since
to penalize functions with union arguments. Doing so encourages
union splits to happen at the call site, rather than having multiple
redundant union splits inside the function. However, for simple functions
of intrinsics and builtins it can make a lot of sense to inline
the union split signature.
@Keno Keno merged commit 4c805d2 into master Sep 14, 2020
@Keno Keno deleted the kf/unionpenalties branch September 14, 2020 14:07
Keno added a commit that referenced this pull request Jul 5, 2023
I added this code back in #27057, when I first made Union-full
signatures inlineable. The justification was to try to encourage
the union splitting to happen on the outside. However (and I believe
this changed since this code was introduced), these days inference
is in complete control of union splitting and we do not take
inlineability or non-inlineability of the non-unionsplit function
into account when deciding how to inline. As a result, the only
effect of the union split penalties was to prevent inlining of
functions that are not union-split eligible (e.g.
`+(::Vararg{Union{Int, Missing}, 3})`), but are nevertheless cheap
by our inlining metric. There is really no reason not to try to
inline such functions, so delete this logic.
Keno added a commit that referenced this pull request Jul 6, 2023
I added this code back in #27057, when I first made Union-full
signatures inlineable. The justification was to try to encourage
the union splitting to happen on the outside. However (and I believe
this changed since this code was introduced), these days inference
is in complete control of union splitting and we do not take
inlineability or non-inlineability of the non-unionsplit function
into account when deciding how to inline. As a result, the only
effect of the union split penalties was to prevent inlining of
functions that are not union-split eligible (e.g.
`+(::Vararg{Union{Int, Missing}, 3})`), but are nevertheless cheap
by our inlining metric. There is really no reason not to try to
inline such functions, so delete this logic.
Keno added a commit that referenced this pull request Jul 6, 2023
I added this code back in #27057, when I first made Union-full
signatures inlineable. The justification was to try to encourage
the union splitting to happen on the outside. However (and I believe
this changed since this code was introduced), these days inference
is in complete control of union splitting and we do not take
inlineability or non-inlineability of the non-unionsplit function
into account when deciding how to inline. As a result, the only
effect of the union split penalties was to prevent inlining of
functions that are not union-split eligible (e.g.
`+(::Vararg{Union{Int, Missing}, 3})`), but are nevertheless cheap
by our inlining metric. There is really no reason not to try to
inline such functions, so delete this logic.
Keno added a commit that referenced this pull request Jul 7, 2023
I added this code back in #27057, when I first made Union-full
signatures inlineable. The justification was to try to encourage
the union splitting to happen on the outside. However (and I believe
this changed since this code was introduced), these days inference
is in complete control of union splitting and we do not take
inlineability or non-inlineability of the non-unionsplit function
into account when deciding how to inline. As a result, the only
effect of the union split penalties was to prevent inlining of
functions that are not union-split eligible (e.g.
`+(::Vararg{Union{Int, Missing}, 3})`), but are nevertheless cheap
by our inlining metric. There is really no reason not to try to
inline such functions, so delete this logic.
Keno added a commit that referenced this pull request Jul 7, 2023
I added this code back in #27057, when I first made Union-full
signatures inlineable. The justification was to try to encourage
the union splitting to happen on the outside. However (and I believe
this changed since this code was introduced), these days inference
is in complete control of union splitting and we do not take
inlineability or non-inlineability of the non-unionsplit function
into account when deciding how to inline. As a result, the only
effect of the union split penalties was to prevent inlining of
functions that are not union-split eligible (e.g.
`+(::Vararg{Union{Int, Missing}, 3})`), but are nevertheless cheap
by our inlining metric. There is really no reason not to try to
inline such functions, so delete this logic.
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.

3 participants