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

Allow more top-down inlining for single-BB callees #138157

Merged
merged 1 commit into from
Mar 14, 2025

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Mar 7, 2025

This means that things like <usize as Step>::forward_unchecked and <PartialOrd for f32>::le will inline even if
we've already done a bunch of inlining to find the calls to them.

Fixes #138136

Draft as it's built atop #138135, which adds a mir-opt test that's a nice demonstration of this. To see just this change, look at 48f63e3 Rebased to be just the inlining change, as the other existing tests show it great.

@rustbot
Copy link
Collaborator

rustbot commented Mar 7, 2025

r? @Noratrieb

rustbot has assigned @Noratrieb.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Mar 7, 2025
@scottmcm
Copy link
Member Author

scottmcm commented Mar 7, 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 Mar 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 7, 2025
…<try>

Allow more top-down inlining for single-BB callees

This means that things like `<usize as Step>::forward_unchecked` and `<PartialOrd for f32>::le` will inline even if
we've already done a bunch of inlining to find the calls to them.

Fixes rust-lang#138136

Draft as it's built atop rust-lang#138135, which adds a mir-opt test that's a nice demonstration of this.
@bors
Copy link
Contributor

bors commented Mar 7, 2025

⌛ Trying commit 48f63e3 with merge 10923a0...

}

bb5: {
_8 = AddUnchecked(copy _7, const 1_u32);
Copy link
Member Author

Choose a reason for hiding this comment

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

Huzzah, a Range loop is finally optimized down to just the AddUnchecked(i, 1), no Step trait indirection.

cc @FractalFir who will probably appreciate this for other backends.

@bors
Copy link
Contributor

bors commented Mar 7, 2025

☀️ Try build successful - checks-actions
Build commit: 10923a0 (10923a044371351c6571ba4981524da06812575c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (10923a0): comparison URL.

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

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.8% [0.3%, 1.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.9%, -0.3%] 4
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.1%] 2
All ❌✅ (primary) -0.1% [-0.9%, 1.3%] 6

Max RSS (memory usage)

Results (primary -0.6%, secondary -0.3%)

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)
4.4% [1.7%, 7.2%] 2
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-5.6% [-6.9%, -4.3%] 2
Improvements ✅
(secondary)
-2.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) -0.6% [-6.9%, 7.2%] 4

Cycles

Results (primary -1.2%)

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.2% [-1.4%, -1.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.2% [-1.4%, -1.0%] 2

Binary size

Results (primary 0.1%, secondary 0.1%)

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.2% [0.0%, 2.3%] 40
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 44
Improvements ✅
(primary)
-0.2% [-1.7%, -0.0%] 21
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 2
All ❌✅ (primary) 0.1% [-1.7%, 2.3%] 61

Bootstrap: 766.551s -> 766.742s (0.02%)
Artifact size: 362.09 MiB -> 362.03 MiB (-0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 7, 2025
@scottmcm scottmcm force-pushed the inline-more-tiny-things branch from 48f63e3 to e6789c8 Compare March 8, 2025 05:03
@scottmcm
Copy link
Member Author

scottmcm commented Mar 8, 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 Mar 8, 2025
@bors
Copy link
Contributor

bors commented Mar 8, 2025

⌛ Trying commit e6789c8 with merge 3827dac...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 8, 2025
…<try>

Allow more top-down inlining for single-BB callees

This means that things like `<usize as Step>::forward_unchecked` and `<PartialOrd for f32>::le` will inline even if
we've already done a bunch of inlining to find the calls to them.

Fixes rust-lang#138136

~~Draft as it's built atop rust-lang#138135, which adds a mir-opt test that's a nice demonstration of this.  To see just this change, look at <https://github.com/rust-lang/rust/pull/138157/commits/48f63e3be552605c2933056b77bf23a326757f92>~~ Rebased to be just the inlining change, as the other existing tests show it great.
@bors
Copy link
Contributor

bors commented Mar 8, 2025

☀️ Try build successful - checks-actions
Build commit: 3827dac (3827dac7a7e728ea164b3c64e4dd1fb716c06a58)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3827dac): comparison URL.

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

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.8% [0.4%, 1.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.9%, -0.3%] 5
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.4%] 3
All ❌✅ (primary) -0.2% [-0.9%, 1.3%] 7

Max RSS (memory usage)

Results (primary -2.5%, secondary -3.0%)

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)
6.6% [6.6%, 6.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.3% [-8.5%, -2.3%] 5
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) -2.5% [-8.5%, 6.6%] 6

Cycles

Results (primary -1.2%, secondary -0.3%)

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.9% [1.9%, 1.9%] 1
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) -1.2% [-1.2%, -1.2%] 1

Binary size

Results (primary 0.1%, secondary 0.1%)

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.2% [0.0%, 2.3%] 48
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 44
Improvements ✅
(primary)
-0.2% [-0.9%, -0.0%] 14
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 2
All ❌✅ (primary) 0.1% [-0.9%, 2.3%] 62

Bootstrap: 766.525s -> 765.262s (-0.16%)
Artifact size: 362.15 MiB -> 362.08 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 8, 2025
@scottmcm scottmcm force-pushed the inline-more-tiny-things branch from e6789c8 to 154f715 Compare March 9, 2025 01:24
@rust-log-analyzer

This comment has been minimized.

@scottmcm scottmcm force-pushed the inline-more-tiny-things branch from 154f715 to d30af47 Compare March 9, 2025 03:00
@scottmcm
Copy link
Member Author

scottmcm commented Mar 9, 2025

@bors try @rust-timer queue

@bors
Copy link
Contributor

bors commented Mar 13, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 13, 2025
This means that things like `<usize as Step>::forward_unchecked` and `<PartialOrd for f32>::le` will inline even if we've already done a bunch of inlining to find the calls to them.
@scottmcm scottmcm force-pushed the inline-more-tiny-things branch from d30af47 to 91af4aa Compare March 13, 2025 06:46
@scottmcm
Copy link
Member Author

Oh, apparently x86_64-unknown-linux-gnu gets an extra function attribute despite the test being -C no-prepopulate-passes. Updated define voiddefine{{.+}}void in the test to allow extra stuff there.

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Mar 13, 2025

📌 Commit 91af4aa 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 Mar 13, 2025
@bors
Copy link
Contributor

bors commented Mar 13, 2025

⌛ Testing commit 91af4aa with merge dcd9720...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2025
…oli-obk

Allow more top-down inlining for single-BB callees

This means that things like `<usize as Step>::forward_unchecked` and `<PartialOrd for f32>::le` will inline even if
we've already done a bunch of inlining to find the calls to them.

Fixes rust-lang#138136

~~Draft as it's built atop rust-lang#138135, which adds a mir-opt test that's a nice demonstration of this.  To see just this change, look at <https://github.com/rust-lang/rust/pull/138157/commits/48f63e3be552605c2933056b77bf23a326757f92>~~ Rebased to be just the inlining change, as the other existing tests show it great.
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [codegen] tests\codegen\sanitizer\kcfi\emit-kcfi-operand-bundle-attr-no-sanitize.rs#aarch64 stdout ----

error in revision `aarch64`: auxiliary build of "D:\\a\\rust\\rust\\tests\\auxiliary\\minicore.rs" failed to compile: 
status: exit code: 1
command: PATH="D:\a\rust\rust\build\x86_64-pc-windows-gnu\stage2\bin;D:\a\rust\rust\build\x86_64-pc-windows-gnu\stage0-bootstrap-tools\x86_64-pc-windows-gnu\release\deps;D:\a\rust\rust\build\x86_64-pc-windows-gnu\stage0\bin;D:\a\rust\rust\ninja;D:\a\rust\rust\mingw64\bin;C:\msys64\usr\bin;D:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.442-6\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe" "D:\\a\\rust\\rust\\tests\\auxiliary\\minicore.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=C:\\Users\\runneradmin\\.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=D:\\a\\rust\\rust\\vendor" "--sysroot" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2" "--cfg" "aarch64" "--check-cfg" "cfg(test,FALSE,aarch64,x86_64)" "-O" "-Cdebug-assertions=no" "-C" "prefer-dynamic" "-o" "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\codegen\\sanitizer\\kcfi\\emit-kcfi-operand-bundle-attr-no-sanitize.aarch64\\libminicore.rlib" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\native\\rust-test-helpers" "--target" "aarch64-unknown-none" "-Cno-prepopulate-passes" "-Zsanitizer=kcfi" "-Copt-level=0" "-Cpanic=abort" "--crate-type" "rlib" "-Cpanic=abort"
stdout: none
--- stderr -------------------------------
error: couldn't create a temp dir: Access is denied. (os error 5) at path "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcfzdxGW"

error: aborting due to 1 previous error
------------------------------------------


---
test result: FAILED. 692 passed; 1 failed; 142 ignored; 0 measured; 3 filtered out; finished in 25.40s

Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-pc-windows-gnu target=x86_64-pc-windows-gnu
Build completed unsuccessfully in 1:36:31
make: *** [Makefile:128: ci-mingw-x] Error 1
  local time: Fri Mar 14 00:40:22 CUT 2025
  network time: Fri, 14 Mar 2025 00:40:22 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Contributor

bors commented Mar 14, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 14, 2025
@scottmcm
Copy link
Member Author

2025-03-14T00:40:22.1512202Z --- stderr -------------------------------
2025-03-14T00:40:22.1580734Z error: couldn't create a temp dir: Access is denied. (os error 5) at path "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcfzdxGW"
2025-03-14T00:40:22.1581195Z 
2025-03-14T00:40:22.1581369Z error: aborting due to 1 previous error
2025-03-14T00:40:22.1581672Z ------------------------------------------

@bors retry (x86_64-pc-windows-gnu transient Windows filesystem access issue)

@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 Mar 14, 2025
@bors
Copy link
Contributor

bors commented Mar 14, 2025

⌛ Testing commit 91af4aa with merge 523c507...

@bors
Copy link
Contributor

bors commented Mar 14, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 14, 2025
@bors bors merged commit 523c507 into rust-lang:master Mar 14, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 14, 2025
@scottmcm scottmcm deleted the inline-more-tiny-things branch March 14, 2025 07:02
Copy link

Post-merge analysis result

Test differences

  • aarch64-gnu
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • [codegen] tests/codegen/range-loop.rs: [missing] -> ignore (ignored when std is built with debug assertions)
    • library/core/src/mem/mod.rs - mem::variant_count (line 1175): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1107): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1128): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 902): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1330): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1303): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::transmute_copy (line 976): [missing] -> pass
    • (and 23 additional testss)
  • x86_64-gnu-llvm-18-2
    • library/core/src/mem/mod.rs - mem::discriminant (line 1128): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 902): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1330): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 893): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1267): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1280): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1303): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1090): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • (and 23 additional testss)
  • x86_64-gnu-stable
    • library/core/src/mem/mod.rs - mem::offset_of (line 1267): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1330): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1107): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1280): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::transmute_copy (line 976): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 893): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1090): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 880): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • (and 23 additional testss)
  • i686-msvc-1
    • library/core/src/mem/mod.rs - mem::drop (line 893): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1107): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1280): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1330): [missing] -> pass
    • [codegen] tests/codegen/range-loop.rs: [missing] -> ignore (ignored when std is built with debug assertions)
    • library/core/src/mem/mod.rs - mem::transmute_copy (line 976): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 918): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1267): [missing] -> pass
    • (and 23 additional testss)
  • x86_64-gnu-nopt
    • library/core/src/mem/mod.rs - mem::transmute_copy (line 976): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 918): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 947): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1107): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::variant_count (line 1175): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 902): [missing] -> pass
    • [codegen] tests/codegen/range-loop.rs: [missing] -> ignore (ignored when std is built with debug assertions)
    • library/core/src/mem/mod.rs - mem::drop (line 880): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1128): [missing] -> pass
    • (and 23 additional testss)
  • aarch64-apple
    • library/core/src/mem/mod.rs - mem::drop (line 880): [missing] -> pass
    • [codegen] tests/codegen/range-loop.rs: [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 947): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1128): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 918): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 902): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1267): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 893): [missing] -> pass
    • (and 23 additional testss)
  • x86_64-gnu-llvm-18-1
    • library/core/src/mem/mod.rs - mem::drop (line 880): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1303): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1090): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 902): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1280): [missing] -> pass
    • [codegen] tests/codegen/range-loop.rs: [missing] -> ignore (ignored when std is built with debug assertions)
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::variant_count (line 1175): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::transmute_copy (line 976): [missing] -> pass
    • (and 23 additional testss)
  • i686-gnu-nopt-1
    • library/core/src/mem/mod.rs - mem::drop (line 902): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1330): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1090): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1303): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1128): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1280): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::transmute_copy (line 976): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 880): [missing] -> pass
    • (and 23 additional testss)
  • x86_64-gnu-llvm-19-3
    • library/core/src/mem/mod.rs - mem::drop (line 880): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 947): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1280): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::transmute_copy (line 976): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::variant_count (line 1175): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 893): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1107): [missing] -> pass
    • [codegen] tests/codegen/range-loop.rs: [missing] -> ignore (ignored when std is built with debug assertions)
    • (and 23 additional testss)
  • x86_64-gnu-llvm-19-1
    • library/core/src/mem/mod.rs - mem::discriminant (line 1128): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1330): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::variant_count (line 1175): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::drop (line 893): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::discriminant (line 1107): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1212): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1280): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::offset_of (line 1267): [missing] -> pass
    • library/core/src/mem/mod.rs - mem::copy (line 940): [missing] -> pass
    • [codegen] tests/codegen/range-loop.rs: [missing] -> ignore (ignored when std is built with debug assertions)
    • (and 23 additional testss)

(and 10 additional diffs)

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (523c507): comparison URL.

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

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
1.0% [0.5%, 1.4%] 2
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
-0.7% [-1.1%, -0.4%] 5
Improvements ✅
(secondary)
-0.6% [-0.7%, -0.6%] 3
All ❌✅ (primary) -0.2% [-1.1%, 1.4%] 7

Max RSS (memory usage)

Results (primary 2.9%)

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)
3.7% [0.7%, 6.5%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.9% [-2.7%, 6.5%] 8

Cycles

Results (primary -0.9%, secondary 1.8%)

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.9% [2.5%, 3.4%] 12
Improvements ✅
(primary)
-0.9% [-1.5%, -0.6%] 5
Improvements ✅
(secondary)
-4.3% [-5.8%, -2.9%] 2
All ❌✅ (primary) -0.9% [-1.5%, -0.6%] 5

Binary size

Results (primary 0.0%, secondary -0.3%)

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.2% [0.0%, 2.7%] 36
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 40
Improvements ✅
(primary)
-0.1% [-0.5%, -0.0%] 44
Improvements ✅
(secondary)
-1.0% [-2.7%, -0.1%] 17
All ❌✅ (primary) 0.0% [-0.5%, 2.7%] 80

Bootstrap: 774.074s -> 772.321s (-0.23%)
Artifact size: 364.97 MiB -> 364.98 MiB (0.00%)

@scottmcm
Copy link
Member Author

That serde icount regression looks like noise; it went back down again in #138480 (comment)

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Mar 19, 2025
…oli-obk

Allow more top-down inlining for single-BB callees

This means that things like `<usize as Step>::forward_unchecked` and `<PartialOrd for f32>::le` will inline even if
we've already done a bunch of inlining to find the calls to them.

Fixes rust-lang#138136

~~Draft as it's built atop rust-lang#138135, which adds a mir-opt test that's a nice demonstration of this.  To see just this change, look at <https://github.com/rust-lang/rust/pull/138157/commits/48f63e3be552605c2933056b77bf23a326757f92>~~ Rebased to be just the inlining change, as the other existing tests show it great.
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
7 participants