-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Skip no-op drop glue #142508
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
base: master
Are you sure you want to change the base?
Skip no-op drop glue #142508
Conversation
Since 122662 this no longer gets used in vtables, so we're safe to fully drop generating these empty functions. Those are eventually cleaned up by LLVM, but it's wasteful to produce them in the first place.
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Skip noop drop glue Since #122662 this no longer gets used in vtables, so we're safe to fully drop generating these empty functions. Those are eventually cleaned up by LLVM, but it's wasteful to produce them in the first place. Opening this for a perf run before asking for review.
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (d28feb0): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.5%, secondary 2.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.1%, secondary -0.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.3%, secondary -1.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 757.645s -> 756.931s (-0.09%) |
c839507
to
1573ec4
Compare
//~ MONO_ITEM fn <Struct<u32> as Trait>::foo | ||
//~ MONO_ITEM fn <Struct<u32> as Trait>::bar | ||
let r1 = &s1 as &Trait; | ||
r1.foo(); | ||
r1.bar(); | ||
|
||
let s1 = Struct { _a: 0u64 }; | ||
//~ MONO_ITEM fn std::ptr::drop_in_place::<Struct<u64>> - shim(None) @@ instantiation_through_vtable-cgu.0[External] | ||
//~ MONO_ITEM fn <Struct<u64> as Trait>::foo | ||
//~ MONO_ITEM fn <Struct<u64> as Trait>::bar | ||
let _ = &s1 as &Trait; |
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.
It seems to me this test is mostly a duplicate of the unsizing test, so I'm skipping updating it with its own drop glue variant -- seems like that's covered there. Maybe worth deleting one of these entirely in a follow-up PR though.
This comment has been minimized.
This comment has been minimized.
1573ec4
to
9549f6b
Compare
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
Some changes occurred in tests/codegen/sanitizer cc @rcvalle |
Since #122662 this no longer gets used in vtables, so we're safe to fully
drop generating these empty functions. Those are eventually cleaned up
by LLVM, but it's wasteful to produce them in the first place.
This doesn't appear to be a significant win (and shows some slight regressions) but
seems like the right thing to do. At minimum it reduces noise in the LLVM IR we generate,
which seems like a good thing.