Shrink no-op drop elaboration#157491
Conversation
These would become simple gotos anyway, so save the cost of creating such blocks.
We are not modifying these blocks afterwards, so no need to create clean ones each time. Drive-by fix for async drops with enums.
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
r? @mejrs rustbot has assigned @mejrs. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Shrink no-op drop elaboration
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (0f76dc7): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in 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.0%, secondary 0.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%, secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 514.669s -> 516.17s (0.29%) |
|
r? me |
Drop elaboration can be very verbose, especially when locals are move-from by parts. This happens a lot with
?desugaring for instance.I start from the example given in #157463 and attempt to shrink the generated code.
The remaining empty
gotoblocks come from resetting drop flags. The cost/benefit of the refactor was less interesting.