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

Normalize before checking if local is freeze in deduced_param_attrs #114948

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Aug 17, 2023

Not normalizing the local type eagerly results in possibly exponential amounts of normalization happening downstream in is_freeze_raw.

Fixes #113372

@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 2023

r? @b-naber

(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. labels Aug 17, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@compiler-errors
Copy link
Member Author

I guess this could use a perf run

@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 Aug 17, 2023
@bors
Copy link
Contributor

bors commented Aug 17, 2023

⌛ Trying commit 20c648c with merge a3452177e320564baeae47dfb4113efbfc3bd448...

@bors
Copy link
Contributor

bors commented Aug 17, 2023

☀️ Try build successful - checks-actions
Build commit: a3452177e320564baeae47dfb4113efbfc3bd448 (a3452177e320564baeae47dfb4113efbfc3bd448)

@rust-timer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented Aug 18, 2023

arrr equals mii with green perf

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a3452177e320564baeae47dfb4113efbfc3bd448): 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)
-4.1% [-4.6%, -3.6%] 2
Improvements ✅
(secondary)
-3.4% [-4.3%, -2.7%] 3
All ❌✅ (primary) -4.1% [-4.6%, -3.6%] 2

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: 635.3s -> 635.541s (0.04%)
Artifact size: 347.04 MiB -> 347.11 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 18, 2023
@compiler-errors
Copy link
Member Author

cool cool

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Aug 18, 2023

📌 Commit 20c648c has been approved by lcnr

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 Aug 18, 2023
@bors
Copy link
Contributor

bors commented Aug 18, 2023

⌛ Testing commit 20c648c with merge 0f7f6b7...

@bors
Copy link
Contributor

bors commented Aug 18, 2023

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 0f7f6b7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 18, 2023
@bors bors merged commit 0f7f6b7 into rust-lang:master Aug 18, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 18, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0f7f6b7): 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)

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)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
-2.2% [-2.5%, -1.9%] 2
All ❌✅ (primary) -1.0% [-1.0%, -1.0%] 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: 633.173s -> 634.503s (0.21%)
Artifact size: 347.02 MiB -> 346.93 MiB (-0.03%)

@jakubadamw
Copy link
Contributor

Could this perhaps be backported to 1.72? It looks as though it may fix the seemingly unending compilation people (including our team) are seeing with 1.72.0.

@lqd
Copy link
Member

lqd commented Aug 28, 2023

@jakubadamw how are compilation times on the latest nightlies for you, compared to 1.72.0? (Or more precisely, using rustup-toolchain-install-master: this PR artifacts' 0f7f6b70617fbcda9f73755fa9b560bfb0a588eb, versus its parent's a1e1dba9cc40a90409bccb8b19e359c4bdf573e5).

If this PR indeed fixes the issue for you, it would make a good case for a backport (as the change also looks simple enough) in addition to the other similar reports, and we could then stable-nominate it. (it's now been done anyways)

@saethlin
Copy link
Member

I suspect there are more reports of this problem in this issue: #115216

@gen-xu
Copy link

gen-xu commented Aug 28, 2023

and similar one here on 1.72.0 #115207

@compiler-errors compiler-errors added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Aug 28, 2023
@apiraino
Copy link
Contributor

I wonder if this could also fix #115283 (also slow compile time, actix_web crate involved)

@compiler-errors
Copy link
Member Author

@apiraino: this PR does not fix that issue. I noted the reason for the slowness in #115283 (comment).

@wesleywiser
Copy link
Member

I could not repro the memory usage reported in #115216 either before or after this change.

I am able to confirm this change fixes #115207.

@apiraino
Copy link
Contributor

apiraino commented Sep 1, 2023

Stable backport approved as per compiler team on Zulip. Team thinks this perf. regression is impacting enough to open a discussion about a dot release.

@rustbot label +stable-accepted

@rustbot rustbot added the stable-accepted Accepted for backporting to the compiler in the stable channel. label Sep 1, 2023
@Mark-Simulacrum Mark-Simulacrum removed the stable-nominated Nominated for backporting to the compiler in the stable channel. label Sep 12, 2023
@Mark-Simulacrum Mark-Simulacrum modified the milestones: 1.73.0, 1.72.1 Sep 12, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 12, 2023
…Simulacrum

[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality rust-lang#115215
*  implied bounds: do not ICE on unconstrained region vars rust-lang#115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236
*  Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 12, 2023
…Simulacrum

[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality rust-lang#115215
*  implied bounds: do not ICE on unconstrained region vars rust-lang#115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236
*  Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 13, 2023
…Simulacrum

[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality rust-lang#115215
*  implied bounds: do not ICE on unconstrained region vars rust-lang#115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236
*  Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 13, 2023
…Simulacrum

[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality rust-lang#115215
*  implied bounds: do not ICE on unconstrained region vars rust-lang#115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236
*  Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 13, 2023
…Simulacrum

[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality rust-lang#115215
*  implied bounds: do not ICE on unconstrained region vars rust-lang#115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236
*  Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 13, 2023
…Simulacrum

[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality rust-lang#115215
*  implied bounds: do not ICE on unconstrained region vars rust-lang#115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236
*  Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 13, 2023
…Simulacrum

[stable] 1.72.1 release

This backports:

*  Remove assert that checks type equality rust-lang#115215
*  implied bounds: do not ICE on unconstrained region vars rust-lang#115559
*  rustdoc: correctly deal with self ty params when eliding default object lifetimes rust-lang#115276
*  Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen rust-lang#115236
*  Normalize before checking if local is freeze in deduced_param_attrs rust-lang#114948

Some cherry-picks required merge conflict resolution, we'll see if I got it right based on CI (rustdoc fix and LLVM codegen test).

r? `@Mark-Simulacrum`
mmastrac added a commit to denoland/deno that referenced this pull request Sep 20, 2023
> 1.72.1 resolves a few regressions introduced in 1.72.0:

> - [Partially revert codegen change, improving
codegen](rust-lang/rust#115236)
> - [rustdoc: Fix self ty params in objects with
lifetimes](rust-lang/rust#115276)
> - [Fix regression in compile
times](rust-lang/rust#114948)
> - Resolve some ICEs in the compiler:
>   - [#115215](rust-lang/rust#115215)
>   - [#115559](rust-lang/rust#115559)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. stable-accepted Accepted for backporting to the compiler in the stable channel. 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.

perf regression between nightly 2023-06-28 and 2023-07-01