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

inlining: follow #45272, improve the finalizer inlining implementation #45934

Merged
merged 2 commits into from
Jul 13, 2022

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Jul 5, 2022

  • 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

@aviatesk aviatesk requested a review from Keno July 5, 2022 09:35
@aviatesk aviatesk force-pushed the avi/follow-45272 branch from e9eff5c to 38f028e Compare July 6, 2022 07:49
@aviatesk
Copy link
Member Author

aviatesk commented Jul 7, 2022

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

@nanosoldier
Copy link
Collaborator

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

@aviatesk aviatesk force-pushed the avi/follow-45272 branch 2 times, most recently from 7c49f16 to 352121c Compare July 11, 2022 09:02
Comment on lines +1354 to +1368
# 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
Copy link
Member Author

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.

@aviatesk aviatesk changed the title inlining: follow #45272, improve finalizer inlining robustness inlining: follow #45272, improve the finalizer inlining implementation Jul 12, 2022
@aviatesk
Copy link
Member Author

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

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - no performance regressions were detected. A full report can be found here.

aviatesk added 2 commits July 13, 2022 10:33
- 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
@aviatesk aviatesk merged commit 201d4f6 into master Jul 13, 2022
@aviatesk aviatesk deleted the avi/follow-45272 branch July 13, 2022 09:02
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.

2 participants