work around a splatting penalty in twiceprecision#29060
Merged
KristofferC merged 2 commits intomasterfrom Sep 6, 2018
Merged
Conversation
Member
|
Oh interesting. We have special support for splatting tuples, but this is sometimes splatting numbers to just pass one argument, and there we hit the pessimistic case: julia> f(x) = println(x...)
f (generic function with 1 method)
julia> @code_typed f(1)
CodeInfo(
1 1 ─ %1 = (Core._apply)(Main.println, x)::Const(nothing, false) │
└── return %1 │
) => Nothing
julia> @code_typed f((1,2))
CodeInfo(
1 1 ─ %1 = (getfield)(x, 1)::Int64 │
│ %2 = (getfield)(x, 2)::Int64 │
│ %3 = invoke Main.println(%1::Int64, %2::Int64)::Const(nothing, false)│
└── return %3 │
) => NothingMaybe add an |
Member
I think Jarrett was working on this some in #28955 |
Member
|
Ref. #27434 (comment) re. elision of |
mbauman
approved these changes
Sep 6, 2018
Keno
approved these changes
Sep 6, 2018
Member
Keno
left a comment
There was a problem hiding this comment.
LGTM, though we should fix the underlying compiler issue also.
Member
Author
|
When that happens I'll happily revert :) |
KristofferC
added a commit
that referenced
this pull request
Sep 6, 2018
* work around a splatting penalty in twiceprecision * add allocation test (cherry picked from commit 88d536a)
Merged
KristofferC
added a commit
that referenced
this pull request
Sep 8, 2018
* work around a splatting penalty in twiceprecision * add allocation test (cherry picked from commit 88d536a)
KristofferC
added a commit
that referenced
this pull request
Sep 8, 2018
* work around a splatting penalty in twiceprecision * add allocation test (cherry picked from commit 88d536a)
KristofferC
added a commit
that referenced
this pull request
Feb 11, 2019
* work around a splatting penalty in twiceprecision * add allocation test (cherry picked from commit 88d536a)
Keno
added a commit
that referenced
this pull request
Jul 19, 2020
But keep the test. This workaround is no longer required, because the compiler can now understand this pattern. This reverts commit 88d536a.
Keno
added a commit
that referenced
this pull request
Jul 19, 2020
simeonschaub
pushed a commit
to simeonschaub/julia
that referenced
this pull request
Aug 11, 2020
…29060)" (JuliaLang#36728) But keep the test. This workaround is no longer required, because the compiler can now understand this pattern. This reverts commit 88d536a.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before:
After:
Ref https://discourse.julialang.org/t/a-possible-regression-in-0-7/14597
The typed code before this PR looks like
so not sure why that is not devirtualized (if this is the correct term here).