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

Sync rustc_codegen_gcc 2023/06/19 #112814

Merged
merged 168 commits into from
Jun 22, 2023
Merged

Conversation

antoyo
Copy link
Contributor

@antoyo antoyo commented Jun 19, 2023

Hi.
This is a sync of the rustc_codegen_gcc subtree.
Thanks.

cuviper and others added 30 commits August 16, 2022 15:46
Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.
Because `PassMode::Cast` is by far the largest variant, but is
relatively rare.

This requires making `PassMode` not impl `Copy`, and `Clone` is no
longer necessary. This causes lots of sigil adjusting, but nothing very
notable.
Currently they try to be very precise. But they are wrong, i.e. they
don't match what's happening in the loop below. This code isn't hot
enough for it to matter that much.
Because it's only ever set to `None` or `Some(Reg::i32())`.
Because it's only needed for that variant. This shrinks the types and
clarifies the logic.
Shrink `FnAbi`

Because they can take up a lot of memory in debug and release builds.

r? `@bjorn3`
Add pointer masking convenience functions

This PR adds the following public API:
```rust
impl<T: ?Sized> *const T {
    fn mask(self, mask: usize) -> *const T;
}

impl<T: ?Sized> *mut T {
    fn mask(self, mask: usize) -> *const T;
}

// mod intrinsics
fn mask<T>(ptr: *const T, mask: usize) -> *const T
```
This is equivalent to `ptr.map_addr(|a| a & mask)` but also uses a cool llvm intrinsic.

Proposed in rust-lang#95643 (comment)

cc `@Gankra` `@scottmcm` `@RalfJung`

r? rust-lang/libs-api
…oli-obk

interpret: make read-pointer-as-bytes a CTFE-only error with extra information

Next step in the reaction to rust-lang#99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes rust-lang/miri#2456.

Pointer-to-int transmutation during CTFE now produces a message like this:
```
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
```

r? ``@oli-obk``
…ister,antoyo

Move the cast_float_to_int fallback code to GCC

Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.
@rustbot
Copy link
Collaborator

rustbot commented Jun 19, 2023

r? @b-naber

(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 Jun 19, 2023
@rust-log-analyzer

This comment has been minimized.

@b-naber
Copy link
Contributor

b-naber commented Jun 20, 2023

r? compiler

@rustbot rustbot assigned davidtwco and unassigned b-naber Jun 20, 2023
@bjorn3
Copy link
Member

bjorn3 commented Jun 20, 2023

@bors r+ subtree sync

@bors
Copy link
Contributor

bors commented Jun 20, 2023

📌 Commit f78096f has been approved by bjorn3

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 Jun 20, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 21, 2023
…jorn3

Sync rustc_codegen_gcc 2023/06/19

Hi.
This is a sync of the rustc_codegen_gcc subtree.
Thanks.
@bors
Copy link
Contributor

bors commented Jun 22, 2023

⌛ Testing commit f78096f with merge fba636a...

@bors
Copy link
Contributor

bors commented Jun 22, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 22, 2023
@bors bors merged commit fba636a into rust-lang:master Jun 22, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 22, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fba636a): 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
Improvements ✅
(secondary)
-1.3% [-1.3%, -1.3%] 1
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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.0% [-1.5%, -0.6%] 7
Improvements ✅
(secondary)
-2.8% [-3.9%, -2.3%] 3
All ❌✅ (primary) -1.0% [-1.5%, -0.6%] 7

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: 659.342s -> 658.42s (-0.14%)

antoyo pushed a commit to antoyo/rust that referenced this pull request Oct 9, 2023
Sync rustc_codegen_gcc 2023/06/19

Hi.
This is a sync of the rustc_codegen_gcc subtree.
Thanks.
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.