Skip to content

experient to understand MaybeDangling perf regression - #162357

Draft
RalfJung wants to merge 2 commits into
rust-lang:mainfrom
RalfJung:maybe-dangling-perf
Draft

experient to understand MaybeDangling perf regression#162357
RalfJung wants to merge 2 commits into
rust-lang:mainfrom
RalfJung:maybe-dangling-perf

Conversation

@RalfJung

@RalfJung RalfJung commented Sep 6, 2026

Copy link
Copy Markdown
Member

How did #160745 cause a slowdown?

@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 Sep 6, 2026
@RalfJung

RalfJung commented Sep 6, 2026

Copy link
Copy Markdown
Member 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 6, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 6, 2026
experient to understand MaybeDangling perf regression
@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)

---- [codegen] tests/codegen-llvm/maybe_dangling_refs.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/checkout/tests/codegen-llvm/maybe_dangling_refs.rs:12:11: error: CHECK: expected string not found in input
// CHECK: define {{(dso_local )?}}noundef nonnull ptr @f(ptr noundef nonnull %x) unnamed_addr
          ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/maybe_dangling_refs/maybe_dangling_refs.ll:1:1: note: scanning from here
; ModuleID = 'maybe_dangling_refs.9ac11b7eb2eadbaf-cgu.0'
^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/maybe_dangling_refs/maybe_dangling_refs.ll:7:1: note: possible intended match here
define noundef nonnull ptr @f(ptr noalias noundef nonnull %x) unnamed_addr #0 {
^

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/maybe_dangling_refs/maybe_dangling_refs.ll
Check file: /checkout/tests/codegen-llvm/maybe_dangling_refs.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ; ModuleID = 'maybe_dangling_refs.9ac11b7eb2eadbaf-cgu.0' 
check:12'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: source_filename = "maybe_dangling_refs.9ac11b7eb2eadbaf-cgu.0" 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: target triple = "aarch64-unknown-linux-gnu" 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5:  
check:12'0     ~
            6: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: define noundef nonnull ptr @f(ptr noalias noundef nonnull %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:12'1     ?                                                                                possible intended match
            8: start: 
check:12'0     ~~~~~~~
            9:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           10: } 
check:12'0     ~~
           11:  
check:12'0     ~
           12: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           13: define noundef nonnull ptr @f2(ptr noalias noundef nonnull %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           14: start: 
check:12'0     ~~~~~~~
           15:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           16: } 
check:12'0     ~~
           17:  
check:12'0     ~
           18: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           19: define noundef nonnull ptr @g(ptr noalias nofree noundef readonly captures(address, read_provenance) dereferenceable(1) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           20: start: 
check:12'0     ~~~~~~~
           21:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           22: } 
check:12'0     ~~
           23:  
check:12'0     ~
           24: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           25: define noundef nonnull ptr @h(ptr noalias nofree noundef dereferenceable(1) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26: start: 
check:12'0     ~~~~~~~
           27:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           28: } 
check:12'0     ~~
           29:  
check:12'0     ~
           30: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           31: define noundef nonnull align 4 ptr @i(ptr noalias noundef nonnull align 4 %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           32: start: 
check:12'0     ~~~~~~~
           33:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           34: } 
check:12'0     ~~
           35:  
check:12'0     ~
           36: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           37: define noundef nonnull align 4 ptr @j(ptr noalias nofree noundef readonly align 4 captures(address, read_provenance) dereferenceable(4) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           38: start: 
check:12'0     ~~~~~~~
           39:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           40: } 
check:12'0     ~~
           41:  
check:12'0     ~
           42: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           43: define noundef nonnull align 4 ptr @k(ptr noalias nofree noundef align 4 dereferenceable(4) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           44: start: 
check:12'0     ~~~~~~~
           45:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           46: } 
check:12'0     ~~
           47:  
check:12'0     ~
           48: attributes #0 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           49:  
check:12'0     ~
           50: !llvm.module.flags = !{!0, !1, !2} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           51: !llvm.ident = !{!3} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~
           52:  
check:12'0     ~
           53: !0 = !{i32 8, !"PIC Level", i32 2} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           54: !1 = !{i32 7, !"uwtable", i32 2} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           55: !2 = !{i32 7, !"frame-pointer", i32 1} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           56: !3 = !{!"rustc version 1.100.0-nightly (ce87dade7 2026-09-06)"} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-21/bin/FileCheck" "--input-file" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/maybe_dangling_refs/maybe_dangling_refs.ll" "/checkout/tests/codegen-llvm/maybe_dangling_refs.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen-llvm/maybe_dangling_refs.rs:12:11: error: CHECK: expected string not found in input
// CHECK: define {{(dso_local )?}}noundef nonnull ptr @f(ptr noundef nonnull %x) unnamed_addr
          ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/maybe_dangling_refs/maybe_dangling_refs.ll:1:1: note: scanning from here
; ModuleID = 'maybe_dangling_refs.9ac11b7eb2eadbaf-cgu.0'
^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/maybe_dangling_refs/maybe_dangling_refs.ll:7:1: note: possible intended match here
define noundef nonnull ptr @f(ptr noalias noundef nonnull %x) unnamed_addr #0 {
^

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/maybe_dangling_refs/maybe_dangling_refs.ll
Check file: /checkout/tests/codegen-llvm/maybe_dangling_refs.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ; ModuleID = 'maybe_dangling_refs.9ac11b7eb2eadbaf-cgu.0' 
check:12'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: source_filename = "maybe_dangling_refs.9ac11b7eb2eadbaf-cgu.0" 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: target triple = "aarch64-unknown-linux-gnu" 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5:  
check:12'0     ~
            6: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: define noundef nonnull ptr @f(ptr noalias noundef nonnull %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:12'1     ?                                                                                possible intended match
            8: start: 
check:12'0     ~~~~~~~
            9:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           10: } 
check:12'0     ~~
           11:  
check:12'0     ~
           12: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           13: define noundef nonnull ptr @f2(ptr noalias noundef nonnull %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           14: start: 
check:12'0     ~~~~~~~
           15:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           16: } 
check:12'0     ~~
           17:  
check:12'0     ~
           18: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           19: define noundef nonnull ptr @g(ptr noalias nofree noundef readonly captures(address, read_provenance) dereferenceable(1) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           20: start: 
check:12'0     ~~~~~~~
           21:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           22: } 
check:12'0     ~~
           23:  
check:12'0     ~
           24: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           25: define noundef nonnull ptr @h(ptr noalias nofree noundef dereferenceable(1) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26: start: 
check:12'0     ~~~~~~~
           27:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           28: } 
check:12'0     ~~
           29:  
check:12'0     ~
           30: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           31: define noundef nonnull align 4 ptr @i(ptr noalias noundef nonnull align 4 %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           32: start: 
check:12'0     ~~~~~~~
           33:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           34: } 
check:12'0     ~~
           35:  
check:12'0     ~
           36: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           37: define noundef nonnull align 4 ptr @j(ptr noalias nofree noundef readonly align 4 captures(address, read_provenance) dereferenceable(4) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           38: start: 
check:12'0     ~~~~~~~
           39:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           40: } 
check:12'0     ~~
           41:  
check:12'0     ~
           42: ; Function Attrs: uwtable 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           43: define noundef nonnull align 4 ptr @k(ptr noalias nofree noundef align 4 dereferenceable(4) %x) unnamed_addr #0 { 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           44: start: 
check:12'0     ~~~~~~~
           45:  ret ptr %x 
check:12'0     ~~~~~~~~~~~~
           46: } 
check:12'0     ~~
           47:  
check:12'0     ~
           48: attributes #0 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           49:  
check:12'0     ~
           50: !llvm.module.flags = !{!0, !1, !2} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           51: !llvm.ident = !{!3} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~
           52:  
check:12'0     ~
           53: !0 = !{i32 8, !"PIC Level", i32 2} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           54: !1 = !{i32 7, !"uwtable", i32 2} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           55: !2 = !{i32 7, !"frame-pointer", i32 1} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           56: !3 = !{!"rustc version 1.100.0-nightly (ce87dade7 2026-09-06)"} 
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
------------------------------------------

---- [codegen] tests/codegen-llvm/maybe_dangling_refs.rs stdout end ----

@rust-bors

rust-bors Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a46f4b6 (a46f4b6d2f668fc0e23930f99bc61071389c911a)
Base parent: dbad1ba (dbad1bab60868d49978b716635ac2c3203e327cf)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a46f4b6): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never rustc-perf
@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
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 3
Improvements ✅
(primary)
-0.3% [-0.7%, -0.2%] 75
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.2%] 20
All ❌✅ (primary) -0.3% [-0.7%, -0.2%] 75

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (primary -2.7%, secondary -3.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)
- - 0
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) -2.7% [-2.7%, -2.7%] 1

Binary size

Results (primary 0.0%)

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

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

Bootstrap: 478.423s -> 476.031s (-0.50%)
Artifact size: 403.41 MiB -> 403.38 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants