Skip to content
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

Use assert_unchecked instead of assume intrinsic in the standard library #119892

Merged
merged 2 commits into from Jan 23, 2024

Conversation

joboet
Copy link
Contributor

@joboet joboet commented Jan 12, 2024

Now that a public wrapper for the assume intrinsic exists, we can use it in the standard library.

CC #119131

@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2024

r? @cuviper

(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 Jan 12, 2024
@rust-log-analyzer

This comment has been minimized.

@cuviper
Copy link
Member

cuviper commented Jan 17, 2024

Let's check since these are some perf-sensitive areas.

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

Use `assert_unchecked` instead of `assume` intrinsic in the standard library

Now that a public wrapper for the `assume` intrinsic exists, we can use it in the standard library.

CC rust-lang#119131
@bors
Copy link
Contributor

bors commented Jan 17, 2024

⌛ Trying commit fa9a911 with merge c412b31...

@bors
Copy link
Contributor

bors commented Jan 17, 2024

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c412b31): comparison URL.

Overall result: ❌ regressions - no 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.

@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.4%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.4%] 2

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)
4.2% [4.1%, 4.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.1% [-6.1%, -2.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.4% [-6.1%, 4.3%] 6

Cycles

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

Binary size

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

Bootstrap: 663.655s -> 664.42s (0.12%)
Artifact size: 308.29 MiB -> 308.25 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 17, 2024
@Nilstrieb
Copy link
Member

< 855,631,981  ???:
   83,964,055    llvm::ConstantRange::multiply(llvm::ConstantRange const&) const
  -82,809,045    llvm::APInt::operator*(llvm::APInt const&) const
  -80,350,293    llvm::SelectionDAGISel::CodeGenAndEmitDAG()
  -74,448,936    (anonymous namespace)::ModuleBitcodeWriter::writeDICompositeType(llvm::DICompositeType const*, llvm::SmallVectorImpl<unsigned long>&, unsigned int)
   72,695,458    llvm::BasicAAResult::alias(llvm::MemoryLocation const&, llvm::MemoryLocation const&, llvm::AAQueryInfo&, llvm::Instruction const*)
   59,936,189    llvm::SelectionDAG::LegalizeVectors()

Probably due to the additional IR having to be processed.. This seems fine to me though, the regression is really small on only two benchmarks. if wg-perf disagrees during triage, feel free to complain.
@bors r+

@bors
Copy link
Contributor

bors commented Jan 18, 2024

📌 Commit fa9a911 has been approved by Nilstrieb

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 Jan 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 19, 2024
…Nilstrieb

Use `assert_unchecked` instead of `assume` intrinsic in the standard library

Now that a public wrapper for the `assume` intrinsic exists, we can use it in the standard library.

CC rust-lang#119131
@bors
Copy link
Contributor

bors commented Jan 19, 2024

⌛ Testing commit fa9a911 with merge 4f20ebe...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 19, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 19, 2024
@joboet
Copy link
Contributor Author

joboet commented Jan 22, 2024

As nikic suggested, the codegen tests failed because debug-assertions are turned in some CI runners. They are now ignored in that case.

@cuviper
Copy link
Member

cuviper commented Jan 23, 2024

@bors r=Nilstrieb,cuviper

@bors
Copy link
Contributor

bors commented Jan 23, 2024

📌 Commit 638439a has been approved by Nilstrieb,cuviper

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 Jan 23, 2024
@bors
Copy link
Contributor

bors commented Jan 23, 2024

⌛ Testing commit 638439a with merge e35a56d...

@bors
Copy link
Contributor

bors commented Jan 23, 2024

☀️ Test successful - checks-actions
Approved by: Nilstrieb,cuviper
Pushing e35a56d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 23, 2024
@bors bors merged commit e35a56d into rust-lang:master Jan 23, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 23, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e35a56d): comparison URL.

Overall result: ❌ regressions - 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)
1.2% [0.6%, 1.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
4.2% [1.9%, 7.7%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.9% [-14.0%, -2.1%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-14.0%, 7.7%] 14

Cycles

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

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.0%, 0.2%] 4
Regressions ❌
(secondary)
0.3% [0.0%, 1.8%] 7
Improvements ✅
(primary)
-0.2% [-0.6%, -0.0%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-0.6%, 0.2%] 10

Bootstrap: 662.56s -> 662.94s (0.06%)
Artifact size: 308.33 MiB -> 308.35 MiB (0.01%)

@joboet joboet deleted the libs_use_assert_unchecked branch February 18, 2024 09:44
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. 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.

None yet

7 participants