-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
inlining: follow #45272, improve the finalizer inlining implementation #45934
Conversation
e9eff5c
to
38f028e
Compare
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
7c49f16
to
352121c
Compare
# Test that we can inline a finalizer that just returns a constant value | ||
mutable struct DoAllocConst | ||
function DoAllocConst() | ||
finalizer(new()) do this | ||
return nothing | ||
end | ||
end | ||
end | ||
let src = code_typed1() do | ||
for i = 1:1000 | ||
DoAllocConst() | ||
end | ||
end | ||
@test count(isnew, src.code) == 0 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some more test cases. They are all working on the master except for this DoAllocConst
case, and it's fixed by the second commit.
352121c
to
df51157
Compare
finalizer
inlining robustness
@nanosoldier |
Your benchmark job has completed - no performance regressions were detected. A full report can be found here. |
- added more comments to explain the purpose of code - properly handle `ConstantCase` - erase `Core.finalizer` call more aggressively - improved type stabilities by handling edge cases - renamed `AddFianlizerUse` to `FinalizerUse` - removed dead pieces of code
df51157
to
7bab5d5
Compare
ConstantCase
Core.finalizer
call more aggressivelyAddFianlizerUse
toFinalizerUse