Skip to content

Tell LLVM that the negation in <*const T>::sub cannot overflow #114720

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

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

scottmcm
Copy link
Member

Today it's just sub https://rust.godbolt.org/z/8EzEPnMr5; with this PR it's sub nsw.

@rustbot
Copy link
Collaborator

rustbot commented Aug 11, 2023

r? @joshtriplett

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 11, 2023
@scottmcm
Copy link
Member Author

I don't think sub is as common as add, but just in case...

@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 Aug 11, 2023
@bors
Copy link
Collaborator

bors commented Aug 11, 2023

⌛ Trying commit ab6e2bc with merge b4b635338cfd4b18dc878054b630903d604090f1...

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b4b635338cfd4b18dc878054b630903d604090f1): 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)
0.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-0.7%, -0.3%] 3
Improvements ✅
(secondary)
-0.5% [-0.7%, -0.2%] 6
All ❌✅ (primary) -0.3% [-0.7%, 0.3%] 4

Max RSS (memory usage)

Results

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.0% [2.5%, 8.1%] 3
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-5.2% [-5.5%, -4.9%] 2
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) 1.5% [-5.5%, 8.1%] 5

Cycles

Results

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

Binary size

Results

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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.6%, -0.0%] 44
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.6%, 0.1%] 45

Bootstrap: 632.934s -> 631.913s (-0.16%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 11, 2023
@scottmcm
Copy link
Member Author

One small regression that seems easily outweighed by the larger number of improvements.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Aug 11, 2023
Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

neat!

Comment on lines +1006 to +1008
if T::IS_ZST {
// Pointer arithmetic does nothing when the pointee is a ZST.
self
Copy link
Member

Choose a reason for hiding this comment

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

...huh, I for some reason didn't expect that to be true.

@workingjubilee
Copy link
Member

Agreed.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

📌 Commit ab6e2bc has been approved by workingjubilee

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 Aug 11, 2023
@workingjubilee
Copy link
Member

wait I'm silly.
@bors rollup=never

@workingjubilee
Copy link
Member

r? @workingjubilee

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

⌛ Testing commit ab6e2bc with merge b08dd92...

@bors
Copy link
Collaborator

bors commented Aug 12, 2023

☀️ Test successful - checks-actions
Approved by: workingjubilee
Pushing b08dd92 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 12, 2023
@bors bors merged commit b08dd92 into rust-lang:master Aug 12, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 12, 2023
@scottmcm scottmcm deleted the better-sub branch August 12, 2023 02:15
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b08dd92): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.2%] 9
Improvements ✅
(secondary)
-0.4% [-0.5%, -0.3%] 4
All ❌✅ (primary) -0.3% [-0.3%, -0.2%] 9

Max RSS (memory usage)

Results

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% [2.5%, 8.1%] 5
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-2.5% [-4.9%, -0.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [-4.9%, 8.1%] 7

Cycles

Results

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

Binary size

Results

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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.7%, -0.0%] 44
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.7%, 0.1%] 45

Bootstrap: 631.476s -> 632.009s (0.08%)

@rustbot rustbot removed the perf-regression Performance regression. label Aug 12, 2023
@workingjubilee
Copy link
Member

and the one regression was just noise lol.

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-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-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.

6 participants