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

Fixup if T::CONST in MIR #123259

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

scottmcm
Copy link
Member

r? ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 31, 2024
@@ -25,19 +25,18 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
debug slice => _1;
let _3: usize;
let mut _5: std::ptr::NonNull<[T]>;
let mut _8: bool;
Copy link
Member Author

Choose a reason for hiding this comment

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

This PR means this local -- and its associated storage markers -- are no longer needed.

@scottmcm
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 31, 2024
@bors
Copy link
Contributor

bors commented Mar 31, 2024

⌛ Trying commit 2fb9d27 with merge 3d3fbc3...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2024

/// A `MirPass` for simplifying `if T::CONST`.
///
/// Today, MIR building for things like `if T::IS_ZST` introduce a constant
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// Today, MIR building for things like `if T::IS_ZST` introduce a constant
/// Today, MIR building for things like `if T::IS_ZST` introduce a temporary

#[derive(Default)]
pub struct SwitchConst;

impl<'tcx> MirPass<'tcx> for SwitchConst {
Copy link
Member

Choose a reason for hiding this comment

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

Note that as a pass that runs in opt-level 0, this pass should not do UB-based reasoning or transform code with UB into code without UB. Miri relies on that.

The pass seems fine but this is worth pointing out with a comment as the requirement is implicit in the absence of an opt-level check.

@bors
Copy link
Contributor

bors commented Mar 31, 2024

☀️ Try build successful - checks-actions
Build commit: 3d3fbc3 (3d3fbc3c91e604af5b9b333f21043027fab15906)

@rust-timer

This comment has been minimized.

let target = targets.target_for_value(const_discr);
bx.br(helper.llbb_with_cleanup(self, target));
return;
};
}
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: cg_clif needs this too

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3d3fbc3): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@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.6% [0.4%, 0.9%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-1.3%, -0.2%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.3%, 0.9%] 9

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.0% [0.2%, 3.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.6% [-4.6%, -4.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-4.6%, 3.3%] 4

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.8%, 1.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-1.2%, 1.1%] 3

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.6% [0.1%, 2.0%] 62
Regressions ❌
(secondary)
0.5% [0.2%, 2.7%] 18
Improvements ✅
(primary)
-0.4% [-0.8%, -0.1%] 14
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-0.8%, 2.0%] 76

Bootstrap: 668.042s -> 671.806s (0.56%)
Artifact size: 315.71 MiB -> 315.75 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 31, 2024
@Dylan-DPC Dylan-DPC added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 5, 2024
@bors
Copy link
Contributor

bors commented Nov 12, 2024

☔ The latest upstream changes (presumably #132954) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants