rust icon indicating copy to clipboard operation
rust copied to clipboard

Rename `UninhabitedEnumBranching` to `UnreachableEnumBranching`

Open DianQK opened this issue 5 months ago • 9 comments

Per #120268, I rename UninhabitedEnumBranching to UnreachableEnumBranching .

I solved some nits to add some comments.

I adjusted the workaround restrictions. This should be useful for a <= b and if let Some/Ok(v). For enum with few variants, early-tailduplication should not cause compile time overhead.

r? RalfJung

DianQK avatar Mar 09 '24 07:03 DianQK

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

rustbot avatar Mar 09 '24 07:03 rustbot

Thanks for the PR! However, unfortunately I can't review any behavior change in a MIR opt, nor can I tell whether the new tests make sense. r? compiler

RalfJung avatar Mar 09 '24 11:03 RalfJung

@bors try @rust-timer queue

cjgillot avatar Mar 09 '24 18:03 cjgillot

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

rust-timer avatar Mar 09 '24 18:03 rust-timer

:hourglass: Trying commit 2b156bac884035d8bf006aeeb480ef3d27002ca4 with merge ba9e2eebdf0a51a604ce7a9697acbbff9a354bb1...

bors avatar Mar 09 '24 18:03 bors

:sunny: Try build successful - checks-actions Build commit: ba9e2eebdf0a51a604ce7a9697acbbff9a354bb1 (ba9e2eebdf0a51a604ce7a9697acbbff9a354bb1)

bors avatar Mar 09 '24 20:03 bors

Queued ba9e2eebdf0a51a604ce7a9697acbbff9a354bb1 with parent 8401645716b26a8b4c6974dc0680e55e81e9e8a1, future comparison URL. There are currently 2 preceding artifacts in the queue. It will probably take at least ~3.0 hours until the benchmark run finishes.

rust-timer avatar Mar 09 '24 20:03 rust-timer

Finished benchmarking commit (ba9e2eebdf0a51a604ce7a9697acbbff9a354bb1): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never @rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.5% [0.2%, 3.8%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-9.6% [-12.0%, -7.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.9% [-12.0%, 3.8%] 7

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.9% [0.9%, 0.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.9% [0.9%, 0.9%] 1

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.1%, 0.1%] 5

Bootstrap: 650.585s -> 649.35s (-0.19%) Artifact size: 310.34 MiB -> 310.38 MiB (0.01%)

rust-timer avatar Mar 09 '24 23:03 rust-timer

@cjgillot Would you be willing to add yourself to mir-opt in triagebot.toml. Then I can use r? mir-opt. :)

DianQK avatar Mar 11 '24 02:03 DianQK

@bors r+

cjgillot avatar Apr 03 '24 00:04 cjgillot

:pushpin: Commit ec313d1edb83c7b020e590bcbafa8cd19c94e0e9 has been approved by cjgillot

It is now in the queue for this repository.

bors avatar Apr 03 '24 00:04 bors

:hourglass: Testing commit ec313d1edb83c7b020e590bcbafa8cd19c94e0e9 with merge 76cf07d5df52c07c3cd4cfeea1ab32b1cfba71bf...

bors avatar Apr 03 '24 06:04 bors

:sunny: Test successful - checks-actions Approved by: cjgillot Pushing 76cf07d5df52c07c3cd4cfeea1ab32b1cfba71bf to master...

bors avatar Apr 03 '24 08:04 bors

Finished benchmarking commit (76cf07d5df52c07c3cd4cfeea1ab32b1cfba71bf): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-0.3%, -0.3%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
6.0% [4.8%, 7.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.0% [-3.8%, -0.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.8% [-3.8%, 7.0%] 5

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.2% [0.0%, 0.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.3%, -0.0%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-0.3%, 0.3%] 12

Bootstrap: 667.614s -> 668.678s (0.16%) Artifact size: 318.09 MiB -> 318.11 MiB (0.00%)

rust-timer avatar Apr 03 '24 09:04 rust-timer