Skip to content

Stop backends from needing to support nullary intrinsics #142839

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jun 21, 2025

And then remove our infrastructure special casing them. Further improvements can now be done to them by avoiding the intermediate ConstValue step, but let's leave that to follow up work

r? @RalfJung

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2025

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 21, 2025

@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 Jun 21, 2025
@bors
Copy link
Collaborator

bors commented Jun 21, 2025

⌛ Trying commit a44843e with merge a5e9784...

bors added a commit that referenced this pull request Jun 21, 2025
Stop backends from needing to support nullary intrinsics

And then remove our infrastructure special casing them. Further improvements can now be done to them by avoiding the intermediate ConstValue step, but let's leave that to follow up work

r? `@ghost` wanna see perf first
@rust-log-analyzer

This comment has been minimized.


match intrinsic_name {
sym::type_name => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I see this is a code-move & fixup to work in here, but is it worth sorting these arms into the rest of the match? though I guess the other arms are also not sorted simply... it was mostly that needs_drop is between type_id & type_name that caught my eye hehe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, could do that, good point. didn't want to do it in the first commit to kinda make the diff line up

@bors
Copy link
Collaborator

bors commented Jun 21, 2025

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a5e9784): 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)
3.2% [2.8%, 3.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 2
All ❌✅ (primary) 2.0% [-0.3%, 3.5%] 3

Max RSS (memory usage)

Results (primary 3.7%)

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

mean range count
Regressions ❌
(primary)
3.7% [2.0%, 5.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.7% [2.0%, 5.5%] 2

Cycles

Results (primary 2.7%, secondary -6.5%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.8%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.5% [-6.5%, -6.5%] 1
All ❌✅ (primary) 2.7% [2.7%, 2.8%] 2

Binary size

Results (primary 0.4%)

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

mean range count
Regressions ❌
(primary)
0.5% [0.0%, 1.1%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-0.1%, 1.1%] 11

Bootstrap: 691.091s -> 687.91s (-0.46%)
Artifact size: 371.86 MiB -> 371.89 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 22, 2025
@oli-obk oli-obk force-pushed the denullarification branch from a44843e to 1dd711a Compare June 23, 2025 08:35
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from 1dd711a to 93129de Compare June 23, 2025 08:46
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from 93129de to 5952269 Compare June 24, 2025 08:52
@rustbot
Copy link
Collaborator

rustbot commented Jun 24, 2025

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@oli-obk oli-obk force-pushed the denullarification branch from 5952269 to 2082fe8 Compare June 24, 2025 08:55
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from 2082fe8 to cdb3a21 Compare June 24, 2025 12:22
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from cdb3a21 to 7c1059f Compare June 24, 2025 12:59
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from 7c1059f to e1b6aee Compare June 24, 2025 14:03
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from e1b6aee to a005dee Compare June 24, 2025 14:43
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from a005dee to 97b231f Compare June 24, 2025 15:29
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the denullarification branch from 97b231f to 97d514e Compare June 25, 2025 08:09
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-miri failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/pass/shims/x86/intrinsics-x86-avx2.rs ... ok
tests/pass/shims/x86/intrinsics-x86-gfni.rs ... ok

FAILED TEST: tests/pass/float.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-HxvQaw" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass" "tests/pass/float.rs" "--edition" "2021" "--target" "i686-pc-windows-msvc"

error: test got exit status: 101, but expected 0
 = note: the compiler panicked

error: no output was expected
Execute `./miri test --bless` to update `tests/pass/float.stderr` to the actual output
+++ <stderr output>

thread 'main' panicked at tests/pass/float.rs:1378:5:
expected non-determinism, got 16 times the same result: true
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect


full stderr:

thread 'main' panicked at tests/pass/float.rs:1378:5:
expected non-determinism, got 16 times the same result: true
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

full stdout:


FAILURES:
---

Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.29.2/src/lib.rs:369

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/ui-40dd690eb6b2c4a4` (exit status: 1)
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:01:57
  local time: Wed Jun 25 09:11:50 UTC 2025
  network time: Wed, 25 Jun 2025 09:11:50 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@oli-obk

This comment was marked as outdated.

@rustbot rustbot assigned BoxyUwU and unassigned RalfJung Jun 25, 2025
@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 25, 2025

oops wrong PR

r? @RalfJung

@rustbot rustbot assigned RalfJung and unassigned BoxyUwU Jun 25, 2025
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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants