-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
base: master
Are you sure you want to change the base?
Fixup if T::CONST
in MIR
#123259
Conversation
c9c3092
to
2fb9d27
Compare
@@ -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; |
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.
This PR means this local -- and its associated storage markers -- are no longer needed.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Fixup `if T::CONST` in MIR r? ghost
|
||
/// A `MirPass` for simplifying `if T::CONST`. | ||
/// | ||
/// Today, MIR building for things like `if T::IS_ZST` introduce a constant |
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.
/// 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 { |
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.
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.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
let target = targets.target_for_value(const_discr); | ||
bx.br(helper.llbb_with_cleanup(self, target)); | ||
return; | ||
}; | ||
} |
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.
Note to self: cg_clif needs this too
Finished benchmarking commit (3d3fbc3): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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 @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 668.042s -> 671.806s (0.56%) |
☔ The latest upstream changes (presumably #132954) made this pull request unmergeable. Please resolve the merge conflicts. |
r? ghost