Use an interpreter in MIR jump threading - #119461
Merged
Merged
Conversation
Collaborator
|
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
cjgillot
force-pushed
the
jump-threading-interp
branch
from
December 31, 2023 02:26
fe988c2 to
a0be45d
Compare
Collaborator
|
☔ The latest upstream changes (presumably #119675) made this pull request unmergeable. Please resolve the merge conflicts. |
cjgillot
force-pushed
the
jump-threading-interp
branch
3 times, most recently
from
January 11, 2024 10:07
ebbf7b7 to
6f7941e
Compare
cjgillot
force-pushed
the
jump-threading-interp
branch
from
January 16, 2024 23:50
6f7941e to
7012209
Compare
cjgillot
force-pushed
the
jump-threading-interp
branch
from
January 20, 2024 13:44
7012209 to
e72b2b1
Compare
Contributor
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 21, 2024
Rollup of 8 pull requests Successful merges: - rust-lang#116090 (Implement strict integer operations that panic on overflow) - rust-lang#118811 (Use `bool` instead of `PartiolOrd` as return value of the comparison closure in `{slice,Iteraotr}::is_sorted_by`) - rust-lang#119081 (Add Ipv6Addr::is_ipv4_mapped) - rust-lang#119461 (Use an interpreter in MIR jump threading) - rust-lang#119996 (Move OS String implementation into `sys`) - rust-lang#120015 (coverage: Format all coverage tests with `rustfmt`) - rust-lang#120027 (pattern_analysis: Remove `Ty: Copy` bound) - rust-lang#120084 (fix(rust-analyzer): use new pkgid spec to compare) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 21, 2024
Rollup merge of rust-lang#119461 - cjgillot:jump-threading-interp, r=tmiasko Use an interpreter in MIR jump threading This allows to understand assignments of aggregate constants. This case appears more frequently with GVN promoting aggregates to constants.
RalfJung
reviewed
Mar 14, 2024
| BinOp::Ne => ScalarInt::FALSE, | ||
| _ => return None, | ||
| }; | ||
| let value = value.const_.normalize(self.tcx, self.param_env).try_to_scalar_int()?; |
Member
There was a problem hiding this comment.
This makes little sense. If you want to evaluate the constant, call eval, not normalize. normalize is only meant for when you want to keep this around as a mir::Const but for some reason you want to be sure that if it can evaluated, it is a value (but if it cannot be evaluated that's okay, too). It's a pretty strange operation that should be rarely needed.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows to understand assignments of aggregate constants. This case appears more frequently with GVN promoting aggregates to constants.