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

Don't report any errors in lower_intrinsics. #115602

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Sep 6, 2023

Intrinsics should have been type checked earlier.

This is part of moving all mir-opt diagnostics early enough so that they are reliably emitted even in check builds: #49292 (comment)

@rustbot
Copy link
Collaborator

rustbot commented Sep 6, 2023

r? @petrochenkov

(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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 6, 2023
@rustbot
Copy link
Collaborator

rustbot commented Sep 6, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

if self.tcx().is_intrinsic(def_id) {
match self.tcx().item_name(def_id) {
sym::simd_shuffle => {
if !matches!(args[2], Operand::Constant(_)) {
Copy link
Member

Choose a reason for hiding this comment

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

I believe there are a couple of cases where stdarch has a shuffle where the last arg is not an Operand::Constant, but is still constant after LLVM level constprop. I do want this to be fixed though. Handling this in cg_clif requires a bunch of non-trivial code: https://github.com/bjorn3/rustc_codegen_cranelift/blob/0559de65672243a97d6cd6e6ee6a8e8c291ef4ce/src/constant.rs#L476C1-L575 (called from https://github.com/bjorn3/rustc_codegen_cranelift/blob/0559de65672243a97d6cd6e6ee6a8e8c291ef4ce/src/intrinsics/simd.rs#L171-L172) AFAIK stdarch's test suite doesn't get run in rust's CI. Only in the CI of rust-lang/stdarch.

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 just moved the check. We were already checking this. I think the const propagated ones haven't been working for a long time

Copy link
Member

Choose a reason for hiding this comment

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

Looks like it is indeed unreachable for simd_shuffle now, but for simd_insert and simd_extract it is still possible and necessary for stdarch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

every simd_insert usage outside of ui/codegen tests seems to be using constants

for simd_extract, everything but some extract helpers for #60637 are using constants

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and even those helpers are only used in tests

Copy link
Member

Choose a reason for hiding this comment

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

In stdarch there are a couple of IMM8 as u32 which is not a constant. It has to be const { IMM8 as u32 }.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 7, 2023

📌 Commit 65f25fe has been approved by petrochenkov

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 Sep 7, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 7, 2023
…henkov

Don't report any errors in `lower_intrinsics`.

Intrinsics should have been type checked earlier.

This is part of moving all mir-opt diagnostics early enough so that they are reliably emitted even in check builds: rust-lang#49292 (comment)
@bors
Copy link
Contributor

bors commented Sep 7, 2023

⌛ Testing commit 65f25fe with merge c5775a7...

@bors
Copy link
Contributor

bors commented Sep 7, 2023

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing c5775a7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 7, 2023
@bors bors merged commit c5775a7 into rust-lang:master Sep 7, 2023
12 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 7, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c5775a7): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

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

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

Binary size

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

Bootstrap: 628.665s -> 629.749s (0.17%)
Artifact size: 318.00 MiB -> 318.01 MiB (0.00%)

@oli-obk oli-obk deleted the lower_intrinsics branch September 14, 2023 18:31
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-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