Change enum->int casts to not go through MIR casts. by oli-obk · Pull Request #96862 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation52 Commits4 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

oli-obk

follow-up to #96814

this simplifies all backends and even gives LLVM more information about the return value of Rvalue::Discriminant, enabling optimizations in more cases.

@rustbot rustbot added the T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

label

May 9, 2022

@rust-highfive

r? @compiler-errors

(rust-highfive has picked a reviewer for you, use r? to override)

@oli-obk

@rust-timer

Awaiting bors try build completion.

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

@bors

⌛ Trying commit aba79aecc904cc5cd0174804c375a2bdac4baa82 with merge 9070d93994dedb99925dcdbee841e40c34eee7d4...

@oli-obk

RalfJung

RalfJung

RalfJung

@RalfJung

follow-up to #96814

To be clear, your PR needs to land first before #96814 can make progress.

RalfJung

@bjorn3

@rust-log-analyzer

This comment has been minimized.

RalfJung

@RalfJung

Looks like the perf run didn't go through. Not sure if the old try build is still sufficiently up-to-date, so let's
@bors try @rust-timer queue

@rust-timer

Awaiting bors try build completion.

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

@bors

⌛ Trying commit 6acd3d5d4411ab9fd4a566bbd0185ab61a4d94b3 with merge 4abfc5bbf05d4e7b813ae10bca09b45cc3e1dcf2...

@RalfJung

@bors

☀️ Try build successful - checks-actions
Build commit: 4abfc5bbf05d4e7b813ae10bca09b45cc3e1dcf2 (4abfc5bbf05d4e7b813ae10bca09b45cc3e1dcf2)

@rust-timer

@rust-timer

Finished benchmarking commit (4abfc5bbf05d4e7b813ae10bca09b45cc3e1dcf2): comparison url.

Summary:

Regressions 😿 (primary) Regressions 😿 (secondary) Improvements 🎉 (primary) Improvements 🎉 (secondary) All 😿 🎉 (primary)
count1 0 0 0 1 0
mean2 N/A N/A N/A -0.2% N/A
max N/A N/A N/A -0.2% N/A

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf -perf-regression

Footnotes

  1. number of relevant changes
  2. the arithmetic mean of the percent change

@bors

@oli-obk

This is ready for a final review (though is just some minor rebase fixes compared to the earlier version that loses the assumes, too)

@rust-log-analyzer

This comment has been minimized.

@oli-obk

Instead we generate a discriminant rvalue and cast the result of that.

RalfJung

RalfJung

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (r=me), modulo the question and also maybe changing some/all of these new instrument to trace

@oli-obk

@oli-obk

@oli-obk

@bors

📌 Commit 82c73af has been approved by RalfJung

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jul 5, 2022

@bors

@bors

@rust-timer

Finished benchmarking commit (53792b9): comparison url.

Instruction count

mean1 max count2
Regressions 😿 (primary) N/A N/A 0
Regressions 😿 (secondary) N/A N/A 0
Improvements 🎉 (primary) -0.5% -0.5% 1
Improvements 🎉 (secondary) -0.7% -0.7% 1
All 😿🎉 (primary) -0.5% -0.5% 1

Max RSS (memory usage)

Results

mean1 max count2
Regressions 😿 (primary) N/A N/A 0
Regressions 😿 (secondary) 5.1% 5.1% 1
Improvements 🎉 (primary) -0.0% -0.0% 1
Improvements 🎉 (secondary) -2.5% -2.8% 2
All 😿🎉 (primary) -0.0% -0.0% 1

Cycles

Results

mean1 max count2
Regressions 😿 (primary) 2.5% 2.5% 1
Regressions 😿 (secondary) N/A N/A 0
Improvements 🎉 (primary) N/A N/A 0
Improvements 🎉 (secondary) N/A N/A 0
All 😿🎉 (primary) 2.5% 2.5% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change ↩2 ↩3
  2. number of relevant changes ↩2 ↩3

JohnTitor pushed a commit to JohnTitor/rust that referenced this pull request

Jul 26, 2022

@bors

Change enum->int casts to not go through MIR casts.

follow-up to rust-lang#96814

this simplifies all backends and even gives LLVM more information about the return value of Rvalue::Discriminant, enabling optimizations in more cases.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Sep 7, 2022

@bors

Lower the assume intrinsic to a MIR statement

This makes rust-lang#96862 (comment) easier and will generally allow us to cheaply insert assume intrinsic calls in mir building.

r? rust-lang/wg-mir-opt

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request

Oct 11, 2022

@he32

Pkgsrc changes:

Upstream changes:

Version 1.64.0 (2022-09-22)

Language

Compiler

Libraries

Stabilized APIs

These types were previously stable in std::ffi, but are now also available in core and alloc:

These types were previously stable in std::os::raw, but are now also available in core::ffi and std::ffi:

These APIs are now usable in const contexts:

Cargo

Misc

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request

Nov 16, 2022

@he32

Pkgsrc changes:

Upstream changes:

Version 1.64.0 (2022-09-22)

Language

Compiler

Libraries

Stabilized APIs

These types were previously stable in std::ffi, but are now also available in core and alloc:

These types were previously stable in std::os::raw, but are now also available in core::ffi and std::ffi:

These APIs are now usable in const contexts:

Cargo

Misc

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request

Apr 20, 2024

@bors

Lower the assume intrinsic to a MIR statement

This makes rust-lang/rust#96862 (comment) easier and will generally allow us to cheaply insert assume intrinsic calls in mir building.

r? rust-lang/wg-mir-opt

RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request

Apr 27, 2024

@bors

Lower the assume intrinsic to a MIR statement

This makes rust-lang/rust#96862 (comment) easier and will generally allow us to cheaply insert assume intrinsic calls in mir building.

r? rust-lang/wg-mir-opt

Labels

merged-by-bors

This PR was explicitly merged by bors.

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

T-lang

Relevant to the language team, which will review and decide on the PR/issue.