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

Do not clone the Body for ConstProp #115797

Merged
merged 5 commits into from
Sep 13, 2023
Merged

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Sep 12, 2023

Based on #115748 for the POST_MONO_CHECKS flag.

@rustbot
Copy link
Collaborator

rustbot commented Sep 12, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 12, 2023
@rustbot
Copy link
Collaborator

rustbot commented Sep 12, 2023

Some changes occurred in const_evaluatable.rs

cc @BoxyUwU

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes might have occurred in exhaustiveness checking

cc @Nadrieril

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@cjgillot cjgillot added A-mir-opt Area: MIR optimizations and removed WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 12, 2023
@RalfJung
Copy link
Member

Which part of #115748 do you need? If it's just the flag to skip the required_consts loop, it might be easier to just have a single commit with that. I expect that PR to potentially take a bit.

@rust-log-analyzer

This comment has been minimized.

const PANIC_ON_ALLOC_FAIL: bool = true; // all allocations are small (see `MAX_ALLOC_LIMIT`)

const POST_MONO_CHECKS: bool = false; // this MIR is still generic!
Copy link
Member

Choose a reason for hiding this comment

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

Turns out this is not the entire reason, with const-generics we (try to) run regular CTFE on generic MIR as well.

It's just, we really don't need the post-mono checks here since we're not actually doing evaluation.

@cjgillot
Copy link
Contributor 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 Sep 12, 2023
@bors
Copy link
Contributor

bors commented Sep 12, 2023

⌛ Trying commit d0cba3d with merge 438955f...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 12, 2023
Do not clone the Body for ConstProp

Based on rust-lang#115748 for the `POST_MONO_CHECKS` flag.
@blyxyas
Copy link
Member

blyxyas commented Sep 12, 2023

Is there an error with bors or has there been a point in time where this PR modified other submodules (at least, it doesn't modify any Clippy files)? I can't find any commit that modifies one of these files. 🤷‍♀️

@cjgillot
Copy link
Contributor Author

No issue with bors. Just me being lazy and cherry-picking a large commit instead of re-coding 8 lines.

@bors
Copy link
Contributor

bors commented Sep 12, 2023

☀️ Try build successful - checks-actions
Build commit: 438955f (438955f5517859a3ed112a9da26ddb927c256fbb)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (438955f): comparison URL.

Overall result: no relevant changes - no 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.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-1.4%, -1.4%] 1
Improvements ✅
(secondary)
-3.3% [-4.5%, -1.5%] 5
All ❌✅ (primary) -1.4% [-1.4%, -1.4%] 1

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
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 632.565s -> 631.473s (-0.17%)
Artifact size: 317.90 MiB -> 318.05 MiB (0.05%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 13, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Sep 13, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Sep 13, 2023

📌 Commit d0cba3d has been approved by oli-obk

It is now in the queue for this repository.

@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 Sep 13, 2023
@bors
Copy link
Contributor

bors commented Sep 13, 2023

⌛ Testing commit d0cba3d with merge 5adddad...

@bors
Copy link
Contributor

bors commented Sep 13, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 5adddad to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 13, 2023
@bors bors merged commit 5adddad into rust-lang:master Sep 13, 2023
11 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 13, 2023
@cjgillot cjgillot deleted the const-prop-noclone branch September 13, 2023 20:48
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5adddad): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 632.671s -> 632.02s (-0.10%)
Artifact size: 317.85 MiB -> 317.95 MiB (0.03%)

@klensy
Copy link
Contributor

klensy commented Sep 15, 2023

Can this be applied to const_prop_lint too? Code looks c&p at some places.

let dummy_body = &Body::new(
body.source,
(*body.basic_blocks).to_owned(),
body.source_scopes.clone(),
body.local_decls.clone(),
Default::default(),
body.arg_count,
Default::default(),
body.span,
body.generator_kind(),
body.tainted_by_errors,
);

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 18, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 18, 2023
Rollup merge of rust-lang#115908 - cjgillot:lint-noclone, r=oli-obk

Do not clone MIR for const-prop lint.

Addresses rust-lang#115797 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants