Skip to content

Conversation

@saethlin
Copy link
Member

@saethlin saethlin commented Jul 23, 2024

This PR is extremely cooked because I'm just dumping ideas into it that seem good and can bootstrap the compiler without linker errors.

I don't know if all the ideas are good yet.

r? @ghost

@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. labels Jul 23, 2024
@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 Jul 23, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 23, 2024
…try>

Don't add inlinehint to big closures

In an unoptimized incremental build we want as many items as possible to be lowered as GloballyShared, but right now monomorphization makes whole classes of instances all LocalCopy without inspecting the instance's MIR or the session settings.

Right now I'm experimenting to see what kind of an impact this can have. I think there's a pretty core design flaw currently because we make monomorphization decisions about Instances, but `cross_crate_inlinable` takes a DefId.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Jul 23, 2024

⌛ Trying commit c47d3f4 with merge b53ccf2...

@bors
Copy link
Collaborator

bors commented Jul 24, 2024

☀️ Try build successful - checks-actions
Build commit: b53ccf2 (b53ccf21a2cbc0afcf4a3975eb97d4edbdbc3ed9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b53ccf2): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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 a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.0% [0.2%, 34.9%] 38
Regressions ❌
(secondary)
2.2% [0.2%, 9.9%] 25
Improvements ✅
(primary)
-0.6% [-1.5%, -0.2%] 16
Improvements ✅
(secondary)
-33.3% [-66.4%, -0.2%] 2
All ❌✅ (primary) 2.0% [-1.5%, 34.9%] 54

Max RSS (memory usage)

Results (primary -0.6%, secondary 2.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)
5.2% [4.0%, 6.5%] 3
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-3.5% [-7.7%, -2.0%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.6% [-7.7%, 6.5%] 9

Cycles

Results (primary 5.8%, secondary -2.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)
5.8% [1.6%, 37.9%] 20
Regressions ❌
(secondary)
5.1% [2.1%, 10.0%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-34.3% [-66.6%, -2.1%] 2
All ❌✅ (primary) 5.8% [1.6%, 37.9%] 20

Binary size

Results (primary 2.3%, secondary 2.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)
2.9% [0.0%, 7.7%] 56
Regressions ❌
(secondary)
3.0% [0.0%, 10.7%] 27
Improvements ✅
(primary)
-0.0% [-0.2%, -0.0%] 13
Improvements ✅
(secondary)
-0.2% [-0.6%, -0.0%] 11
All ❌✅ (primary) 2.3% [-0.2%, 7.7%] 69

Bootstrap: 771.348s -> 777.681s (0.82%)
Artifact size: 328.86 MiB -> 328.99 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 Jul 24, 2024
@saethlin saethlin force-pushed the closures-can-be-shared branch from c47d3f4 to 14b76c9 Compare July 26, 2024 21:49
@saethlin saethlin changed the title Don't add inlinehint to big closures Rework instantiation mode selection in monomorphization Jul 26, 2024
@saethlin
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Jul 26, 2024

⌛ Trying commit 14b76c9 with merge e5cfe0b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 26, 2024
…try>

Rework instantiation mode selection in monomorphization

This PR is _extremely_ cooked because I'm just dumping ideas into it that seem good and can bootstrap the compiler without linker errors.

I don't know if all the ideas are good yet.

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 26, 2024

☀️ Try build successful - checks-actions
Build commit: e5cfe0b (e5cfe0b0eee8ec2cba6584d4de6cebd69307978b)

@saethlin
Copy link
Member Author

@rust-timer build e5cfe0b

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e5cfe0b): comparison URL.

Overall result: ❌✅ regressions and improvements - BENCHMARK(S) FAILED

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

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • cargo-0.60.0

❗ ❗ ❗ ❗ ❗

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
12.9% [0.1%, 175.6%] 130
Regressions ❌
(secondary)
4.9% [0.2%, 78.6%] 62
Improvements ✅
(primary)
-7.4% [-28.0%, -0.5%] 15
Improvements ✅
(secondary)
-7.9% [-67.2%, -0.4%] 13
All ❌✅ (primary) 10.8% [-28.0%, 175.6%] 145

Max RSS (memory usage)

Results (primary 6.6%, secondary 6.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)
8.0% [1.4%, 28.2%] 51
Regressions ❌
(secondary)
7.6% [3.2%, 13.2%] 13
Improvements ✅
(primary)
-7.8% [-17.0%, -2.9%] 5
Improvements ✅
(secondary)
-4.5% [-5.1%, -4.0%] 2
All ❌✅ (primary) 6.6% [-17.0%, 28.2%] 56

Cycles

Results (primary 15.4%, secondary 5.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)
17.8% [0.9%, 187.8%] 99
Regressions ❌
(secondary)
10.0% [2.3%, 69.0%] 34
Improvements ✅
(primary)
-10.4% [-23.8%, -2.6%] 9
Improvements ✅
(secondary)
-14.0% [-67.4%, -2.2%] 7
All ❌✅ (primary) 15.4% [-23.8%, 187.8%] 108

Binary size

Results (primary 12.1%, secondary 3.4%)

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)
13.6% [0.1%, 80.9%] 134
Regressions ❌
(secondary)
6.7% [0.0%, 76.4%] 66
Improvements ✅
(primary)
-1.1% [-8.3%, -0.0%] 16
Improvements ✅
(secondary)
-4.0% [-11.1%, -0.0%] 29
All ❌✅ (primary) 12.1% [-8.3%, 80.9%] 150

Bootstrap: 769.319s -> 765.958s (-0.44%)
Artifact size: 328.91 MiB -> 329.40 MiB (0.15%)

@saethlin saethlin force-pushed the closures-can-be-shared branch from 14b76c9 to 5254f98 Compare July 27, 2024 17:17
@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 Jul 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 27, 2024
…try>

Rework instantiation mode selection in monomorphization

This PR is _extremely_ cooked because I'm just dumping ideas into it that seem good and can bootstrap the compiler without linker errors.

I don't know if all the ideas are good yet.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Jul 27, 2024

⌛ Trying commit 4f0c766 with merge 422545f...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 27, 2024

☀️ Try build successful - checks-actions
Build commit: 422545f (422545f89f7bcffb5262a4211a7d98413e44161d)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (422545f): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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 a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
66.4% [0.2%, 722.4%] 168
Regressions ❌
(secondary)
37.0% [0.2%, 592.5%] 115
Improvements ✅
(primary)
-12.1% [-72.2%, -0.2%] 19
Improvements ✅
(secondary)
-13.9% [-44.9%, -0.3%] 7
All ❌✅ (primary) 58.4% [-72.2%, 722.4%] 187

Max RSS (memory usage)

Results (primary 23.1%, secondary 4.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)
27.0% [1.0%, 269.4%] 93
Regressions ❌
(secondary)
7.5% [2.1%, 18.7%] 19
Improvements ✅
(primary)
-9.7% [-28.4%, -2.2%] 11
Improvements ✅
(secondary)
-9.3% [-17.7%, -4.5%] 5
All ❌✅ (primary) 23.1% [-28.4%, 269.4%] 104

Cycles

Results (primary 82.9%, secondary 65.7%)

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)
90.5% [0.9%, 724.9%] 138
Regressions ❌
(secondary)
69.8% [1.5%, 659.3%] 70
Improvements ✅
(primary)
-21.3% [-73.7%, -1.3%] 10
Improvements ✅
(secondary)
-29.4% [-41.8%, -5.3%] 3
All ❌✅ (primary) 82.9% [-73.7%, 724.9%] 148

Binary size

Results (primary 159.5%, secondary 54.7%)

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)
170.2% [0.1%, 924.5%] 151
Regressions ❌
(secondary)
62.3% [0.0%, 367.7%] 104
Improvements ✅
(primary)
-1.5% [-8.3%, -0.0%] 10
Improvements ✅
(secondary)
-1.5% [-8.0%, -0.0%] 14
All ❌✅ (primary) 159.5% [-8.3%, 924.5%] 161

Bootstrap: 772.472s -> 768.225s (-0.55%)
Artifact size: 329.05 MiB -> 328.80 MiB (-0.08%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 27, 2024
@Dylan-DPC Dylan-DPC added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2024
@saethlin saethlin force-pushed the closures-can-be-shared branch from 4f0c766 to 0cfe0b4 Compare December 10, 2024 04:37
@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 Dec 10, 2024
@bors
Copy link
Collaborator

bors commented Dec 10, 2024

⌛ Trying commit 0cfe0b4 with merge 161f3c0...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 10, 2024
…try>

Rework instantiation mode selection in monomorphization

This PR is _extremely_ cooked because I'm just dumping ideas into it that seem good and can bootstrap the compiler without linker errors.

I don't know if all the ideas are good yet.

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 10, 2024

☀️ Try build successful - checks-actions
Build commit: 161f3c0 (161f3c0c79b4fe64a58ebc3f76e673076543dec6)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (161f3c0): 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)
2.6% [0.2%, 37.1%] 46
Regressions ❌
(secondary)
2.0% [0.2%, 12.2%] 33
Improvements ✅
(primary)
-0.5% [-2.2%, -0.1%] 31
Improvements ✅
(secondary)
-6.6% [-66.4%, -0.2%] 11
All ❌✅ (primary) 1.4% [-2.2%, 37.1%] 77

Max RSS (memory usage)

Results (primary -0.2%, secondary 2.5%)

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)
5.1% [2.4%, 8.3%] 4
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-3.8% [-6.2%, -1.9%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-6.2%, 8.3%] 10

Cycles

Results (primary 5.0%, secondary -1.5%)

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)
5.6% [1.3%, 40.1%] 22
Regressions ❌
(secondary)
5.2% [1.7%, 12.3%] 10
Improvements ✅
(primary)
-1.6% [-1.8%, -1.5%] 2
Improvements ✅
(secondary)
-23.9% [-66.9%, -1.9%] 3
All ❌✅ (primary) 5.0% [-1.8%, 40.1%] 24

Binary size

Results (primary 1.8%, secondary 2.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)
2.1% [0.0%, 7.7%] 72
Regressions ❌
(secondary)
2.2% [0.1%, 14.3%] 50
Improvements ✅
(primary)
-0.2% [-0.5%, -0.0%] 12
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) 1.8% [-0.5%, 7.7%] 84

Bootstrap: 767.421s -> 772.542s (0.67%)
Artifact size: 331.00 MiB -> 330.90 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 10, 2024
@saethlin saethlin force-pushed the closures-can-be-shared branch from 0cfe0b4 to 46e0452 Compare January 28, 2025 05:32
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
#22 exporting to docker image format
#22 sending tarball 31.1s done
#22 DONE 37.5s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
failures:

---- [codegen] tests/codegen/inline-hint.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-18/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/inline-hint/inline-hint.ll" "/checkout/tests/codegen/inline-hint.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
--- stderr -------------------------------
/checkout/tests/codegen/inline-hint.rs:28:16: error: CHECK-NEXT: is not on the line after the previous match
/checkout/tests/codegen/inline-hint.rs:28:16: error: CHECK-NEXT: is not on the line after the previous match
// CHECK-NEXT: ; Function Attrs: inlinehint
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/inline-hint/inline-hint.ll:481:1: note: 'next' match was here
; Function Attrs: inlinehint nonlazybind uwtable
^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/inline-hint/inline-hint.ll:473:30: note: previous match ended here
; inline_hint::f::{closure#0}
                             ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/inline-hint/inline-hint.ll:474:1: note: non-matching line after previous match is here
; Function Attrs: nonlazybind uwtable

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/inline-hint/inline-hint.ll
Check file: /checkout/tests/codegen/inline-hint.rs


-dump-input=help explains the following input dump.
Input was:
<<<<<<
         .
         .
         .
         .
       381:  
       382: ; inline_hint::f 
       383: ; Function Attrs: nonlazybind uwtable 
       384: define void @_RNvCsfbKkfMIFdil_11inline_hint1f() unnamed_addr #0 personality ptr @rust_eh_personality { 
       386:  %0 = alloca [16 x i8], align 8 
       387:  %_11 = alloca [1 x i8], align 1 
       388:  %_7 = alloca [24 x i8], align 8 
       389:  %_6 = alloca [24 x i8], align 8 
       389:  %_6 = alloca [24 x i8], align 8 
       390:  %_5 = alloca [24 x i8], align 8 
       391:  %_4 = alloca [48 x i8], align 8 
       392:  %_3 = alloca [0 x i8], align 1 
       393:  %b = alloca [24 x i8], align 8 
       394:  call void @llvm.lifetime.start.p0(i64 24, ptr %b) 
       395:  store i32 0, ptr %b, align 8 
       396:  %1 = getelementptr inbounds i8, ptr %b, i64 4 
       397:  store i32 1, ptr %1, align 4 
       398:  %2 = getelementptr inbounds i8, ptr %b, i64 8 
       399:  store i32 2, ptr %2, align 8 
       400:  %3 = getelementptr inbounds i8, ptr %b, i64 16 
       401:  store ptr inttoptr (i64 3 to ptr), ptr %3, align 8 
       402:  call void @llvm.lifetime.start.p0(i64 48, ptr %_4) 
       403:  call void @llvm.lifetime.start.p0(i64 24, ptr %_5) 
       404:  store i8 1, ptr %_11, align 1 
       405: ; call <alloc::string::String>::new 
       406:  call void @_RNvMNtCscIh6zCKkTbU_5alloc6stringNtB2_6String3new(ptr noalias nocapture noundef sret([24 x i8]) align 8 dereferenceable(24) %_5) 
       407:  call void @llvm.lifetime.start.p0(i64 24, ptr %_6) 
       408: ; invoke <alloc::string::String>::new 
       409:  invoke void @_RNvMNtCscIh6zCKkTbU_5alloc6stringNtB2_6String3new(ptr noalias nocapture noundef sret([24 x i8]) align 8 dereferenceable(24) %_6) 
       410:  to label %bb2 unwind label %cleanup 
       411:  
       412: bb9: ; preds = %cleanup 
       413:  %4 = load i8, ptr %_11, align 1, !range !7, !noundef !3 
       414:  %5 = trunc i8 %4 to i1 
       415:  br i1 %5, label %bb8, label %bb7 
       416:  
       417: cleanup: ; preds = %bb2, %start 
       418:  %6 = landingpad { ptr, i32 } 
       419:  cleanup 
       420:  %7 = extractvalue { ptr, i32 } %6, 0 
       421:  %8 = extractvalue { ptr, i32 } %6, 1 
       422:  call void @llvm.lifetime.start.p0(i64 16, ptr %0) 
       423:  store ptr %7, ptr %0, align 8 
       424:  %9 = getelementptr inbounds i8, ptr %0, i64 8 
       425:  store i32 %8, ptr %9, align 8 
       426:  br label %bb9 
       427:  
       428: bb2: ; preds = %start 
       429:  store i8 0, ptr %_11, align 1 
       430: ; invoke inline_hint::A 
       431:  invoke void @_RNcNtCsfbKkfMIFdil_11inline_hint1A0(ptr noalias nocapture noundef sret([48 x i8]) align 8 dereferenceable(48) %_4, ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %_5, ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %_6) 
       432:  to label %bb3 unwind label %cleanup 
       433:  
       434: bb3: ; preds = %bb2 
       435:  call void @llvm.lifetime.end.p0(i64 24, ptr %_6) 
       436:  call void @llvm.lifetime.end.p0(i64 24, ptr %_5) 
       437: ; call core::ptr::drop_in_place::<inline_hint::A> 
       438:  call void @_RINvNtCsimorL8ChBun_4core3ptr13drop_in_placeNtCsfbKkfMIFdil_11inline_hint1AEBI_(ptr noalias noundef align 8 dereferenceable(48) %_4) 
       439:  call void @llvm.lifetime.end.p0(i64 48, ptr %_4) 
       440:  call void @llvm.lifetime.start.p0(i64 24, ptr %_7) 
       441: ; call <(i32, i32, i32, *const i32) as core::clone::Clone>::clone 
       442:  call void @_RNvYTlllPlENtNtCsimorL8ChBun_4core5clone5Clone5cloneCsfbKkfMIFdil_11inline_hint(ptr noalias nocapture noundef sret([24 x i8]) align 8 dereferenceable(24) %_7, ptr noalias noundef readonly align 8 dereferenceable(24) %b) 
       443:  call void @llvm.lifetime.end.p0(i64 24, ptr %_7) 
       444: ; call inline_hint::f::{closure#0} 
       445:  call void @_RNCNvCsfbKkfMIFdil_11inline_hint1f0B3_(ptr noalias noundef nonnull readonly align 1 %_3) 
       446:  call void @llvm.lifetime.end.p0(i64 24, ptr %b) 
       447:  ret void 
       448:  
       449: bb7: ; preds = %bb8, %bb9 
       450:  %10 = load ptr, ptr %0, align 8, !noundef !3 
       451:  %11 = getelementptr inbounds i8, ptr %0, i64 8 
       452:  %12 = load i32, ptr %11, align 8, !noundef !3 
       453:  call void @llvm.lifetime.end.p0(i64 16, ptr %0) 
       454:  %13 = insertvalue { ptr, i32 } poison, ptr %10, 0 
       455:  %14 = insertvalue { ptr, i32 } %13, i32 %12, 1 
       456:  resume { ptr, i32 } %14 
       457:  
       458: bb8: ; preds = %bb9 
       459: ; invoke core::ptr::drop_in_place::<alloc::string::String> 
       460:  invoke void @_RINvNtCsimorL8ChBun_4core3ptr13drop_in_placeNtNtCscIh6zCKkTbU_5alloc6string6StringECsfbKkfMIFdil_11inline_hint(ptr noalias noundef align 8 dereferenceable(24) %_5) #11 
       461:  to label %bb7 unwind label %terminate 
       463: terminate: ; preds = %bb8 
       463: terminate: ; preds = %bb8 
       464:  %15 = landingpad { ptr, i32 } 
       465:  filter [0 x ptr] zeroinitializer 
       466:  %16 = extractvalue { ptr, i32 } %15, 0 
       467:  %17 = extractvalue { ptr, i32 } %15, 1 
       468: ; call core::panicking::panic_in_cleanup 
       469:  call void @_RNvNtCsimorL8ChBun_4core9panicking16panic_in_cleanup() #12 
       470:  unreachable 
       471: } 
       473: ; inline_hint::f::{closure#0} 
       473: ; inline_hint::f::{closure#0} 
       474: ; Function Attrs: nonlazybind uwtable 
       475: define internal void @_RNCNvCsfbKkfMIFdil_11inline_hint1f0B3_(ptr noalias noundef nonnull readonly align 1 %_1) unnamed_addr #0 { 
       477:  ret void 
       478: } 
       479:  
       480: ; inline_hint::A 
       480: ; inline_hint::A 
       481: ; Function Attrs: inlinehint nonlazybind uwtable 
next:28     !~~~~~~~~~~~~~~~~~~~~~~~~~~~                      error: match on wrong line
       482: define internal void @_RNcNtCsfbKkfMIFdil_11inline_hint1A0(ptr dead_on_unwind noalias nocapture noundef writable sret([48 x i8]) align 8 dereferenceable(48) %_0, ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %_1, ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %_2) unnamed_addr #1 { 
       483: start: 
       484:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_0, ptr align 8 %_1, i64 24, i1 false) 
       485:  %0 = getelementptr inbounds i8, ptr %_0, i64 24 
       486:  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %_2, i64 24, i1 false) 
       487:  ret void 
       488: } 
       489:  
       490: ; Function Attrs: nounwind nonlazybind uwtable 
       491: declare noundef i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #3 
       493: ; core::panicking::panic_in_cleanup 
       493: ; core::panicking::panic_in_cleanup 
       494: ; Function Attrs: cold minsize noinline noreturn nounwind nonlazybind optsize uwtable 
       495: declare void @_RNvNtCsimorL8ChBun_4core9panicking16panic_in_cleanup() unnamed_addr #4 
       496:  
       497: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) 
       498: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 
       499:  
       500: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
       501: declare void @llvm.assume(i1 noundef) #6 
       502:  
       503: ; <core::alloc::layout::Layout>::is_size_align_valid 
       504: ; Function Attrs: nonlazybind uwtable 
       505: declare noundef zeroext i1 @_RNvMNtNtCsimorL8ChBun_4core5alloc6layoutNtB2_6Layout19is_size_align_valid(i64 noundef, i64 noundef) unnamed_addr #0 
       507: ; core::panicking::panic_cannot_unwind 
       507: ; core::panicking::panic_cannot_unwind 
       508: ; Function Attrs: cold minsize noinline noreturn nounwind nonlazybind optsize uwtable 
       509: declare void @_RNvNtCsimorL8ChBun_4core9panicking19panic_cannot_unwind() unnamed_addr #4 
       510:  
       511: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none) 
       512: declare i1 @llvm.expect.i1(i1, i1) #7 
       514: ; core::panicking::panic_nounwind 
       514: ; core::panicking::panic_nounwind 
       515: ; Function Attrs: cold noinline noreturn nounwind nonlazybind uwtable 
       516: declare void @_RNvNtCsimorL8ChBun_4core9panicking14panic_nounwind(ptr noalias noundef nonnull readonly align 1, i64 noundef) unnamed_addr #8 
       517:  
       518: ; Function Attrs: nounwind nonlazybind allockind("free") uwtable 
       519: declare void @__rust_dealloc(ptr allocptr noundef, i64 noundef, i64 noundef) unnamed_addr #9 
       520:  
       521: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
       522: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #10 
       523:  
       524: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
       525: declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #10 
       526:  
       527: attributes #0 = { nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+x87,+sse2" } 
       528: attributes #1 = { inlinehint nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+x87,+sse2" } 
       529: attributes #2 = { inlinehint nounwind nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+x87,+sse2" } 
       530: attributes #3 = { nounwind nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+x87,+sse2" } 
       531: attributes #4 = { cold minsize noinline noreturn nounwind nonlazybind optsize uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+x87,+sse2" } 
       532: attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 
       533: attributes #6 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 
       534: attributes #7 = { nocallback nofree nosync nounwind willreturn memory(none) } 
       535: attributes #8 = { cold noinline noreturn nounwind nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+x87,+sse2" } 
       536: attributes #9 = { nounwind nonlazybind allockind("free") uwtable "alloc-family"="__rust_alloc" "probe-stack"="inline-asm" "target-cpu"="x86-64" "target-features"="+x87,+sse2" } 
       537: attributes #10 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 
       538: attributes #11 = { cold } 
       539: attributes #12 = { cold noreturn nounwind } 
       540: attributes #13 = { nounwind } 
       541: attributes #14 = { noreturn nounwind } 
       542:  
       543: !llvm.module.flags = !{!0, !1} 
       544: !llvm.ident = !{!2} 
       545:  
       546: !0 = !{i32 8, !"PIC Level", i32 2} 
       547: !1 = !{i32 2, !"RtLibUseGOT", i32 1} 
       548: !2 = !{!"rustc version 1.86.0-nightly (f37f78d02 2025-01-28)"} 
       549: !3 = !{} 
       550: !4 = !{i64 0, i64 -9223372036854775807} 
       551: !5 = !{i64 1, i64 -9223372036854775807} 
       552: !6 = !{i64 0, i64 -9223372036854775808} 
       553: !7 = !{i8 0, i8 2} 
------------------------------------------



@saethlin
Copy link
Member Author

saethlin commented Feb 9, 2025

I'm making progress on cleaning up all the logic, so this PR would need to be reworked on top of that anyway.

@saethlin saethlin closed this Feb 9, 2025
@saethlin saethlin deleted the closures-can-be-shared branch February 9, 2025 21:49
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-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.

6 participants