Skip to content

Sync from rust 2024/03/04 #464

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 22 commits into from
Mar 5, 2024
Merged

Sync from rust 2024/03/04 #464

merged 22 commits into from
Mar 5, 2024

Conversation

antoyo
Copy link
Contributor

@antoyo antoyo commented Mar 5, 2024

No description provided.

saethlin and others added 18 commits February 20, 2024 12:39
Add "algebraic" fast-math intrinsics, based on fast-math ops that cannot return poison

Setting all of LLVM's fast-math flags makes our fast-math intrinsics very dangerous, because some inputs are UB. This set of flags permits common algebraic transformations, but according to the [LangRef](https://llvm.org/docs/LangRef.html#fastmath), only the flags `nnan` (no nans) and `ninf` (no infs) can produce poison.

And this uses the algebraic float ops to fix rust-lang/rust#120720

cc `@orlp`
…r=nnethercote

Remove useless lifetime of ArchiveBuilder

`trait ArchiveBuilder<'a>` has a seemingly useless lifetime a, so I remove it. If this is intentional, please reject this PR.

```rust
pub trait ArchiveBuilder<'a> {
    fn add_file(&mut self, path: &Path);

    fn add_archive(
        &mut self,
        archive: &Path,
        skip: Box<dyn FnMut(&str) -> bool + 'static>,
    ) -> io::Result<()>;

    fn build(self: Box<Self>, output: &Path) -> bool;
}
```
Much better!

Note that this involves renaming (and updating the value of)
`DIAGNOSTIC_BUILDER` in clippy.
…itive`

Make changes necessary to support these types in the compiler.
…r-errors

Add stubs in IR and ABI for `f16` and `f128`

This is the very first step toward the changes in rust-lang/rust#114607 and the [`f16` and `f128` RFC](https://rust-lang.github.io/rfcs/3453-f16-and-f128.html). It adds the types to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`, and just propagates those out as `unimplemented!` stubs where necessary.

These types do not parse yet so there is no feature gate, and it should be okay to use `unimplemented!`.

The next steps will probably be AST support with parsing and the feature gate.

r? `@compiler-errors`
cc `@Nilstrieb` suggested breaking the PR up in rust-lang/rust#120645 (comment)
Always generate GEP i8 / ptradd for struct offsets

This implements #98615, and goes a bit further to remove `struct_gep` entirely.

Upstream LLVM is in the beginning stages of [migrating to `ptradd`](https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699). LLVM 19 will [canonicalize](llvm/llvm-project#68882) all constant-offset GEPs to i8, which has roughly the same effect as this change.

Fixes #121719.

Split out from #121577.

r? `@nikic`
@antoyo antoyo force-pushed the sync_from_rust_2024_03_04 branch from 01408db to f68a2a2 Compare March 5, 2024 13:59
@antoyo antoyo force-pushed the sync_from_rust_2024_03_04 branch from f68a2a2 to 499d3c2 Compare March 5, 2024 14:19
@GuillaumeGomez GuillaumeGomez force-pushed the sync_from_rust_2024_03_04 branch from 7af8a16 to 42a0d63 Compare March 5, 2024 14:50
@antoyo antoyo force-pushed the sync_from_rust_2024_03_04 branch 4 times, most recently from 8bd9061 to 8279f5b Compare March 5, 2024 16:43
@antoyo antoyo force-pushed the sync_from_rust_2024_03_04 branch from 8279f5b to 86a2bb7 Compare March 5, 2024 16:55
@antoyo antoyo force-pushed the sync_from_rust_2024_03_04 branch from fd34602 to 3b4c58d Compare March 5, 2024 17:53
@antoyo antoyo merged commit b385428 into master Mar 5, 2024
@antoyo antoyo deleted the sync_from_rust_2024_03_04 branch March 5, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants