-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
deduplicate constant evaluation in cranelift backend #104605
Merged
Merged
Conversation
This file contains 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
also sync LLVM and cranelift structure a bit
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
Nov 19, 2022
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
@bors r+ |
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
Nov 19, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 21, 2022
deduplicate constant evaluation in cranelift backend The cranelift backend had two matches on `ConstantKind`, which can be avoided, and used this `eval_for_mir` that nothing else uses... this makes things more consistent with the (better-tested) LLVM backend. I noticed this because cranelift was the only user of `eval_for_mir`. However `try_eval_for_mir` still has one other user in `eval`... the odd thing is that the interpreter has its own `eval_mir_constant` which seems to duplicate the same functionality and does not use `try_eval_for_mir`. No idea what is happening here. r? `@bjorn3` Cc `@lcnr`
This was referenced Nov 21, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 21, 2022
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#104420 (Fix doc example for `wrapping_abs`) - rust-lang#104499 (rustdoc JSON: Use `Function` everywhere and remove `Method`) - rust-lang#104500 (`rustc_ast`: remove `ref` patterns) - rust-lang#104511 (Mark functions created for `raw-dylib` on x86 with DllImport storage class) - rust-lang#104595 (Add `PolyExistentialPredicate` type alias) - rust-lang#104605 (deduplicate constant evaluation in cranelift backend) - rust-lang#104628 (Revert "Update CI to use Android NDK r25b") - rust-lang#104662 (Streamline deriving on packed structs.) - rust-lang#104667 (Revert formatting changes of a test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
bjorn3
pushed a commit
to bjorn3/rust
that referenced
this pull request
Dec 14, 2022
deduplicate constant evaluation in cranelift backend The cranelift backend had two matches on `ConstantKind`, which can be avoided, and used this `eval_for_mir` that nothing else uses... this makes things more consistent with the (better-tested) LLVM backend. I noticed this because cranelift was the only user of `eval_for_mir`. However `try_eval_for_mir` still has one other user in `eval`... the odd thing is that the interpreter has its own `eval_mir_constant` which seems to duplicate the same functionality and does not use `try_eval_for_mir`. No idea what is happening here. r? ``@bjorn3`` Cc ``@lcnr``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-cranelift
Things relevant to the [future] cranelift backend
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.
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.
The cranelift backend had two matches on
ConstantKind
, which can be avoided, and used thiseval_for_mir
that nothing else uses... this makes things more consistent with the (better-tested) LLVM backend.I noticed this because cranelift was the only user of
eval_for_mir
. Howevertry_eval_for_mir
still has one other user ineval
... the odd thing is that the interpreter has its owneval_mir_constant
which seems to duplicate the same functionality and does not usetry_eval_for_mir
. No idea what is happening here.r? @bjorn3
Cc @lcnr