Skip to content

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Oct 2, 2025

For perf test.

r? @ghost

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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 Oct 2, 2025
@nikic
Copy link
Contributor Author

nikic commented Oct 2, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 2, 2025
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 2, 2025
// CHECK-LABEL: @get_len
// CHECK-NEXT: start:
// CHECK-NEXT: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2
// CHECK-NEXT: tail call void @_R{{.+}}__rust_no_alloc_shim_is_unstable_v2()
// CHECK-NEXT: ret i{{[0-9]+}} 3
// CHECK: ret i{{[0-9]+}} 3
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the cause of the ptrtoint/inttoptr casts in this case is SROA on something like this: https://llvm.godbolt.org/z/576Gb1fEx

Ideally this would not produce any casts (there are uses with different types, but those uses are disjoint), but if it does it's probably better to chose ptr as the common type, as ptrtoint(inttoptr) can be elided, unlike the reverse.

Copy link
Member

Choose a reason for hiding this comment

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

as ptrtoint(inttoptr) can be elided, unlike the reverse.

Are you sure that can be elided? It has the side effect of exposing the original address. I feel like you'd need to also prove that nobody knows about that address, which seems impossible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ptrtoint will expose the provenance of the pointer returned by inttoptr. However, inttoptr can only return a previously exposed provenance. As such, ptrtoint is exposing a previously exposed provenance, and the second expose can be elided.

@rust-bors
Copy link

rust-bors bot commented Oct 2, 2025

☀️ Try build successful (CI)
Build commit: cc94b4f (cc94b4f9704e819353d2cc91d0b7cc1a7e767016, parent: 94ecb52bbeeccc990545d4ebc9e9c35dcaf285e3)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cc94b4f): 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.2% [0.1%, 0.4%] 31
Regressions ❌
(secondary)
0.4% [0.1%, 2.0%] 64
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 3
All ❌✅ (primary) 0.1% [-2.9%, 0.4%] 32

Max RSS (memory usage)

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

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results (primary -0.2%, 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.0% [0.0%, 0.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-1.1%, -0.0%] 5
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 36
All ❌✅ (primary) -0.2% [-1.1%, 0.0%] 8

Bootstrap: 470.352s -> 470.75s (0.08%)
Artifact size: 387.80 MiB -> 387.85 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 Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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.

4 participants