Skip to content

[TOY] Run MIR opts before coroutine state transform#145330

Draft
cjgillot wants to merge 6 commits into
rust-lang:mainfrom
cjgillot:optimized-generator
Draft

[TOY] Run MIR opts before coroutine state transform#145330
cjgillot wants to merge 6 commits into
rust-lang:mainfrom
cjgillot:optimized-generator

Conversation

@cjgillot
Copy link
Copy Markdown
Contributor

@cjgillot cjgillot commented Aug 13, 2025

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 13, 2025
@rust-log-analyzer

This comment was marked as outdated.

@cjgillot cjgillot force-pushed the optimized-generator branch from 08f1ddf to 0be736b Compare August 13, 2025 02:16
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Copy Markdown
Contributor Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Aug 13, 2025
[TOY] Run MIR opts before coroutine state transform
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Aug 13, 2025

☀️ Try build successful (CI)
Build commit: b6ae10a (b6ae10aa7319b7ebb6c7b3331dd71a9d6c9c5b4b, parent: 350d0ef0ec0493e6d21cfb265cb8211a0e74d766)

@cjgillot
Copy link
Copy Markdown
Contributor Author

@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 13, 2025
@lqd
Copy link
Copy Markdown
Member

lqd commented Aug 13, 2025

@rust-timer build b6ae10a

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (b6ae10a): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.3%] 3
Regressions ❌
(secondary)
3.0% [0.5%, 8.5%] 8
Improvements ✅
(primary)
-0.3% [-1.2%, -0.1%] 11
Improvements ✅
(secondary)
-1.6% [-4.4%, -0.2%] 16
All ❌✅ (primary) -0.2% [-1.2%, 0.3%] 14

Max RSS (memory usage)

Results (primary -2.4%, secondary 0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.0% [0.9%, 1.1%] 2
Regressions ❌
(secondary)
2.3% [1.5%, 2.9%] 4
Improvements ✅
(primary)
-9.2% [-9.2%, -9.2%] 1
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.4%] 2
All ❌✅ (primary) -2.4% [-9.2%, 1.1%] 3

Cycles

Results (secondary -0.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [2.0%, 5.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-4.1%, -1.6%] 6
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 2.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 4
Regressions ❌
(secondary)
6.4% [0.1%, 18.3%] 18
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 6
Improvements ✅
(secondary)
-0.4% [-6.3%, -0.0%] 19
All ❌✅ (primary) 0.0% [-0.0%, 0.1%] 10

Bootstrap: 468.291s -> 467.628s (-0.14%)
Artifact size: 377.36 MiB -> 377.38 MiB (0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 13, 2025
@bors
Copy link
Copy Markdown
Collaborator

bors commented Aug 20, 2025

☔ The latest upstream changes (presumably #145600) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot force-pushed the optimized-generator branch from 0be736b to dea9eb7 Compare August 20, 2025 00:30
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Copy Markdown
Collaborator

bors commented Aug 27, 2025

☔ The latest upstream changes (presumably #145916) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 17, 2025

☔ The latest upstream changes (presumably #146666) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@cjgillot

This comment was marked as outdated.

@craterbot

This comment was marked as outdated.

@cjgillot

This comment was marked as outdated.

@cjgillot cjgillot force-pushed the optimized-generator branch from 5c25cff to 2918477 Compare October 4, 2025 16:53
@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_mir_transform/src/coroutine.rs
@bors
Copy link
Copy Markdown
Collaborator

bors commented Oct 7, 2025

☔ The latest upstream changes (presumably #145608) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot force-pushed the optimized-generator branch from 2918477 to 5e47c8e Compare October 9, 2025 12:19
@bors
Copy link
Copy Markdown
Collaborator

bors commented Oct 12, 2025

☔ The latest upstream changes (presumably #145513) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot force-pushed the optimized-generator branch from abfdcc9 to 0af6ba6 Compare October 14, 2025 16:29
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the optimized-generator branch from 0af6ba6 to a449789 Compare October 24, 2025 02:46
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the optimized-generator branch from a449789 to 1de953d Compare October 26, 2025 17:40
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the optimized-generator branch from 666387f to 4162960 Compare December 14, 2025 20:53
@bors
Copy link
Copy Markdown
Collaborator

bors commented Dec 27, 2025

☔ The latest upstream changes (presumably #149775) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot force-pushed the optimized-generator branch 2 times, most recently from f12d0a6 to cdbbf48 Compare May 5, 2026 01:22
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@cjgillot cjgillot force-pushed the optimized-generator branch from cdbbf48 to f9204bd Compare May 22, 2026 16:19
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@cjgillot cjgillot force-pushed the optimized-generator branch from f9204bd to 900fc9a Compare May 30, 2026 14:46
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
22 
+ error: `callee` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
+   --> $DIR/deny-async.rs:22:5
+    |
+ LL |     callee();
+    |     ^^^^^^^^ ...`callee` called here
+    |
+    = note: could not be inlined due to: #[rustc_no_mir_inline]
+ 
23 error: `callee_justified` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
24   --> $DIR/deny-async.rs:24:5
25    |

28    |
29    = note: could not be inlined due to: #[rustc_no_mir_inline]
30    = note: `callee_justified` is required to be inlined to: the test requires it
- 
- error: `callee` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
-   --> $DIR/deny-async.rs:22:5
-    |
- LL |     callee();
-    |     ^^^^^^^^ ...`callee` called here
-    |
-    = note: could not be inlined due to: #[rustc_no_mir_inline]
39 
40 error: aborting due to 4 previous errors
41 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/force-inlining/deny-async.rs:22:5
+ error: `callee` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
+   --> $DIR/deny-async.rs:22:5
+    |
+ LL |     callee();
+    |     ^^^^^^^^ ...`callee` called here
+    |
+    = note: could not be inlined due to: #[rustc_no_mir_inline]
+ 


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args force-inlining/deny-async.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/force-inlining/deny-async.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/force-inlining/deny-async" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021" "--crate-type=lib"
stdout: none
--- stderr -------------------------------
error: `callee` is incompatible with `#[rustc_force_inline]`
##[error]  --> /checkout/tests/ui/force-inlining/deny-async.rs:10:1
   |
---
   | --------------- `callee` defined here
   |
   = note: incompatible due to: #[rustc_no_mir_inline]

error: `callee_justified` is incompatible with `#[rustc_force_inline]`
##[error]  --> /checkout/tests/ui/force-inlining/deny-async.rs:16:1
   |
LL | #[rustc_force_inline = "the test requires it"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | //~^ ERROR `callee_justified` is incompatible with `#[rustc_force_inline]`
LL | pub fn callee_justified() {
   | ------------------------- `callee_justified` defined here
   |
   = note: incompatible due to: #[rustc_no_mir_inline]

error: `callee` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
##[error]  --> /checkout/tests/ui/force-inlining/deny-async.rs:22:5
   |
LL |     callee();
   |     ^^^^^^^^ ...`callee` called here
   |
   = note: could not be inlined due to: #[rustc_no_mir_inline]

error: `callee_justified` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
##[error]  --> /checkout/tests/ui/force-inlining/deny-async.rs:24:5
   |
LL |     callee_justified();
   |     ^^^^^^^^^^^^^^^^^^ ...`callee_justified` called here
   |
   = note: could not be inlined due to: #[rustc_no_mir_inline]
   = note: `callee_justified` is required to be inlined to: the test requires it

error: aborting due to 4 previous errors
------------------------------------------

---- [ui] tests/ui/force-inlining/deny-async.rs stdout end ----

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 30, 2026

☔ The latest upstream changes (presumably #157161) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants