Skip to content

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Mar 16, 2024

The main highlight this time is a fix for a recently introduced ICE.

Fixes #122399

r? @ghost

@rustbot label +A-codegen +A-cranelift +T-compiler

nbdd0121 and others added 20 commits February 24, 2024 18:50
Add asm goto support to `asm!`

Tracking issue: rust-lang#119364

This PR implements asm-goto support, using the syntax described in "future possibilities" section of [RFC2873](https://rust-lang.github.io/rfcs/2873-inline-asm.html#asm-goto).

Currently I have only implemented the `label` part, not the `fallthrough` part (i.e. fallthrough is implicit). This doesn't reduce the expressive though, since you can use label-break to get arbitrary control flow or simply set a value and rely on jump threading optimisation to get the desired control flow. I can add that later if deemed necessary.

r? ``@Amanieu``
cc ``@ojeda``
…=RalfJung

Distinguish between library and lang UB in assert_unsafe_precondition

As described in rust-lang#121583 (comment), `assert_unsafe_precondition` now explicitly distinguishes between language UB (conditions we explicitly optimize on) and library UB (things we document you shouldn't do, and maybe some library internals assume you don't do).

`debug_assert_nounwind` was originally added to avoid the "only at runtime" aspect of `assert_unsafe_precondition`. Since then the difference between the macros has gotten muddied. This totally revamps the situation.

Now _all_ preconditions shall be checked with `assert_unsafe_precondition`. If you have a precondition that's only checkable at runtime, do a `const_eval_select` hack, as done in this PR.

r? RalfJung
Expose the Freeze trait again (unstably) and forbid implementing it manually

non-emoji version of rust-lang#121501

cc rust-lang#60715

This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue.

It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: google/zerocopy#941

cc ```@RalfJung```

T-lang signed off on reexposing this unstably: rust-lang#121501 (comment)
…felix

add test ensuring simd codegen checks don't run when a static assertion failed

stdarch relies on this to ensure that SIMD indices are in bounds.

I would love to know why this works, but I can't figure out where codegen decides to not codegen a function if a required-const does not evaluate. `@oli-obk` `@bjorn3` do you have any idea?
@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. has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 16, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@rustbot rustbot added A-codegen Area: Code generation A-cranelift Things relevant to the [future] cranelift backend labels Mar 16, 2024
@bjorn3
Copy link
Member Author

bjorn3 commented Mar 16, 2024

@bors r+ p=1 subtree sync

@bors
Copy link
Collaborator

bors commented Mar 16, 2024

📌 Commit 6697186 has been approved by bjorn3

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 16, 2024
@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 16, 2024
@bors
Copy link
Collaborator

bors commented Mar 16, 2024

⌛ Testing commit 6697186 with merge 2ffa3c8...

@bors
Copy link
Collaborator

bors commented Mar 16, 2024

☀️ Test successful - checks-actions
Approved by: bjorn3
Pushing 2ffa3c8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 16, 2024
@bors bors merged commit 2ffa3c8 into rust-lang:master Mar 16, 2024
@rustbot rustbot added this to the 1.78.0 milestone Mar 16, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2ffa3c8): 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)
2.1% [2.0%, 2.3%] 4
Regressions ❌
(secondary)
3.9% [3.9%, 3.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.0%, 2.3%] 4

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)
6.6% [1.2%, 15.5%] 16
Regressions ❌
(secondary)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 6.6% [1.2%, 15.5%] 16

Binary size

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

Bootstrap: 666.458s -> 668.569s (0.32%)
Artifact size: 312.71 MiB -> 312.77 MiB (0.02%)

@bjorn3 bjorn3 deleted the sync_cg_clif-2024-03-16 branch March 17, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-cranelift Things relevant to the [future] cranelift backend has-merge-commits PR has merge commits, merge with caution. 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.

ICE: hir: index out of bounds: the len is 5 but the index is 5
10 participants