Skip to content

MaybeImprove MaybeUninit #142837

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saethlin
Copy link
Member

I'm investigating possible solutions to #139355.

@rustbot rustbot added 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
@saethlin
Copy link
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 Jun 21, 2025
bors added a commit that referenced this pull request Jun 21, 2025
MaybeImprove MaybeUninit

I'm investigating possible solutions to #139355.
@bors
Copy link
Collaborator

bors commented Jun 21, 2025

⌛ Trying commit 1e1bc5f with merge 6b3cc92...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-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/maybeuninit-rvo.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-19/bin/FileCheck" "--input-file" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen/maybeuninit-rvo/maybeuninit-rvo.ll" "/checkout/tests/codegen/maybeuninit-rvo.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen/maybeuninit-rvo.rs:14:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: call void @llvm.memcpy.
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen/maybeuninit-rvo/maybeuninit-rvo.ll:13:2: note: found here
 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1000) %_0, ptr noundef nonnull align 1 dereferenceable(1000) %x, i64 1000, i1 false)
 ^~~~~~~~~~~~~~~~~~~~~~~
/checkout/tests/codegen/maybeuninit-rvo.rs:28:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: call void @llvm.memcpy.
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen/maybeuninit-rvo/maybeuninit-rvo.ll:25:2: note: found here
 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1000) %_0, ptr noundef nonnull align 1 dereferenceable(1000) %x, i64 1000, i1 false)
 ^~~~~~~~~~~~~~~~~~~~~~~

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

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

Input was:
<<<<<<
        1: ; ModuleID = 'maybeuninit_rvo.85baa64fab381482-cgu.0' 
        2: source_filename = "maybeuninit_rvo.85baa64fab381482-cgu.0" 
        3: target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" 
        4: target triple = "aarch64-unknown-linux-gnu" 
        5:  
        6: ; maybeuninit_rvo::new_from_uninit 
        7: ; Function Attrs: nounwind uwtable 
        8: define void @_ZN15maybeuninit_rvo15new_from_uninit17h3bb6bd9c8758d8a5E(ptr dead_on_unwind noalias nocapture noundef writable writeonly sret([1000 x i8]) align 1 dereferenceable(1000) %_0) unnamed_addr #0 { 
        9: start: 
       10:  %x = alloca [1000 x i8], align 1 
       11:  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %x) 
       12:  call void @init(ptr noundef nonnull %x) #4 
       13:  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1000) %_0, ptr noundef nonnull align 1 dereferenceable(1000) %x, i64 1000, i1 false) 
not:14      !~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                            error: no match expected
       14:  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %x) 
       15:  ret void 
       16: } 
       17:  
       18: ; maybeuninit_rvo::new_from_uninit_unwind 
       19: ; Function Attrs: uwtable 
       20: define void @_ZN15maybeuninit_rvo22new_from_uninit_unwind17hb427b69ebf77e7d4E(ptr dead_on_unwind noalias nocapture noundef writable writeonly sret([1000 x i8]) align 1 dereferenceable(1000) %_0) unnamed_addr #1 { 
       21: start: 
       22:  %x = alloca [1000 x i8], align 1 
       23:  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %x) 
       24:  call void @init_unwind(ptr noundef nonnull %x) 
       25:  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1000) %_0, ptr noundef nonnull align 1 dereferenceable(1000) %x, i64 1000, i1 false) 
not:28      !~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                            error: no match expected
       26:  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %x) 
       27:  ret void 
       28: } 
       29:  
       30: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
       31: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 
       32:  
       33: ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) 
       34: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 
       35:  
       36: ; Function Attrs: nounwind uwtable 
       37: declare void @init(ptr noundef) unnamed_addr #0 
       38:  
       39: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
       40: declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 
       41:  
       42: ; Function Attrs: uwtable 
       43: declare void @init_unwind(ptr noundef) unnamed_addr #1 
       44:  
       45: attributes #0 = { nounwind uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       46: attributes #1 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       47: attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 
       48: attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } 
       49: attributes #4 = { nounwind } 
       50:  
       51: !llvm.module.flags = !{!0} 
       52: !llvm.ident = !{!1} 
       53:  
       54: !0 = !{i32 8, !"PIC Level", i32 2} 
       55: !1 = !{!"rustc version 1.89.0-nightly (843d46a22 2025-06-21)"} 
>>>>>>
------------------------------------------



@bors
Copy link
Collaborator

bors commented Jun 21, 2025

☀️ Try build successful - checks-actions
Build commit: 6b3cc92 (6b3cc9235e039b02dec997d63bec6109b13b694e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6b3cc92): 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.3% [0.1%, 0.8%] 20
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 7
Improvements ✅
(primary)
-4.8% [-4.8%, -4.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-4.8%, 0.8%] 21

Max RSS (memory usage)

Results (primary 0.1%, secondary 2.1%)

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

mean range count
Regressions ❌
(primary)
2.5% [2.2%, 2.9%] 2
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-4.8% [-4.8%, -4.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-4.8%, 2.9%] 3

Cycles

Results (primary -3.2%, secondary 7.3%)

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)
7.3% [7.3%, 7.3%] 1
Improvements ✅
(primary)
-3.2% [-3.2%, -3.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.2% [-3.2%, -3.2%] 1

Binary size

Results (primary 0.1%, secondary 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.1% [0.0%, 0.4%] 28
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) 0.1% [0.0%, 0.4%] 28

Bootstrap: 690.042s -> 692.595s (0.37%)
Artifact size: 371.86 MiB -> 372.01 MiB (0.04%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. 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.

5 participants