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

Rollup of 8 pull requests #114424

Merged
merged 27 commits into from
Aug 3, 2023
Merged

Rollup of 8 pull requests #114424

merged 27 commits into from
Aug 3, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bvanjoi and others added 27 commits July 31, 2023 11:04
@lqd commented on rust-lang#114351 asking
if `sort_by_words(lookup)` is computed repeatedly. I was assuming that
rustc should have no difficulties to hoist it automatically outside of
the loop to avoid repeated pure computation, but according to
 https://godbolt.org/z/frs8Kj1rq it seems like I was wrong:
original version seems to have 2 calls per loop iteration
```
.LBB16_3:
        mov     rbx, qword ptr [r13]
        mov     r14, qword ptr [r13 + 8]
        lea     rdi, [rsp + 40]
        mov     rsi, rbx
        mov     rdx, r14
        call    example::sort_by_words
        lea     rdi, [rsp + 64]
        mov     rsi, qword ptr [rsp + 8]
        mov     rdx, qword ptr [rsp + 16]
        call    example::sort_by_words
        mov     rdi, qword ptr [rsp + 40]
        mov     rdx, qword ptr [rsp + 56]
        mov     rsi, qword ptr [rsp + 64]
        cmp     rdx, qword ptr [rsp + 80]
        mov     qword ptr [rsp + 32], rdi
        mov     qword ptr [rsp + 24], rsi
        jne     .LBB16_5
        call    qword ptr [rip + bcmp@GOTPCREL]
        test    eax, eax
        sete    al
        mov     dword ptr [rsp + 4], eax
        mov     rsi, qword ptr [rsp + 72]
        test    rsi, rsi
        jne     .LBB16_8
        jmp     .LBB16_9
```
but the manually hoisted version just 1:
```
.LBB16_3:
        mov     r13, qword ptr [r15]
        mov     r14, qword ptr [r15 + 8]
        lea     rdi, [rsp + 64]
        mov     rsi, r13
        mov     rdx, r14
        call    example::sort_by_words
        mov     rdi, qword ptr [rsp + 64]
        mov     rdx, qword ptr [rsp + 16]
        cmp     qword ptr [rsp + 80], rdx
        mov     qword ptr [rsp + 32], rdi
        jne     .LBB16_5
        mov     rsi, qword ptr [rsp + 8]
        call    qword ptr [rip + bcmp@GOTPCREL]
        test    eax, eax
        sete    bpl
        mov     rsi, qword ptr [rsp + 72]
        test    rsi, rsi
        jne     .LBB16_8
        jmp     .LBB16_9
```
This code is probably not very hot, but there is no reason to leave
such a low hanging fruit.
…ck-lint, r=cjgillot

Expand, rename and improve `incorrect_fn_null_checks` lint

This PR,

 - firstly, expand the lint by now linting on references
 - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks`
 - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut`

Fixes rust-lang#113601
cc ```@est31```
parser: more friendly hints for handling `async move` in the 2015 edition

Fixes rust-lang#114219

An error is emitted when encountering an async move block in the 2015 edition.

Another appropriate location to raise an error is after executing [let path = this.parse_path(PathStyle::Expr)?](https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/stmt.rs#L152), but it seems somewhat premature to invoke `create_err` at that stage.
…bank

Suggests turbofish in patterns

Fixes rust-lang#114112

r? ```@estebank```
…li-obk

const validation: point at where we found a pointer but expected an integer

Instead of validation just printing "unable to turn pointer into bytes", make this a regular validation error that says where in the value the bad pointer was found. Also distinguish "expected integer, got pointer" from "expected pointer, got partial pointer or mix of pointers".

To avoid duplicating things too much I refactored the diagnostics for validity a bit, so that "got uninit, expected X" and "got pointer, expected X" can share the "X" part. Also all the errors emitted for validation are now grouped under `const_eval_validation` so that they are in a single group in the ftl file.

r? `@oli-obk`
[rustc_span][perf] Hoist lookup sorted by words out of the loop.

```@lqd``` commented on rust-lang#114351 asking if `sort_by_words(lookup)` is computed repeatedly. I was assuming that rustc should have no difficulties to hoist it automatically outside of the loop to avoid repeated pure computation, but according to
 https://godbolt.org/z/frs8Kj1rq it seems like I was wrong:
original version seems to have 2 calls per loop iteration
```
.LBB16_3:
        mov     rbx, qword ptr [r13]
        mov     r14, qword ptr [r13 + 8]
        lea     rdi, [rsp + 40]
        mov     rsi, rbx
        mov     rdx, r14
        call    example::sort_by_words
        lea     rdi, [rsp + 64]
        mov     rsi, qword ptr [rsp + 8]
        mov     rdx, qword ptr [rsp + 16]
        call    example::sort_by_words
        mov     rdi, qword ptr [rsp + 40]
        mov     rdx, qword ptr [rsp + 56]
        mov     rsi, qword ptr [rsp + 64]
        cmp     rdx, qword ptr [rsp + 80]
        mov     qword ptr [rsp + 32], rdi
        mov     qword ptr [rsp + 24], rsi
        jne     .LBB16_5
        call    qword ptr [rip + bcmp@GOTPCREL]
        test    eax, eax
        sete    al
        mov     dword ptr [rsp + 4], eax
        mov     rsi, qword ptr [rsp + 72]
        test    rsi, rsi
        jne     .LBB16_8
        jmp     .LBB16_9
```
but the manually hoisted version just 1:
```
.LBB16_3:
        mov     r13, qword ptr [r15]
        mov     r14, qword ptr [r15 + 8]
        lea     rdi, [rsp + 64]
        mov     rsi, r13
        mov     rdx, r14
        call    example::sort_by_words
        mov     rdi, qword ptr [rsp + 64]
        mov     rdx, qword ptr [rsp + 16]
        cmp     qword ptr [rsp + 80], rdx
        mov     qword ptr [rsp + 32], rdi
        jne     .LBB16_5
        mov     rsi, qword ptr [rsp + 8]
        call    qword ptr [rip + bcmp@GOTPCREL]
        test    eax, eax
        sete    bpl
        mov     rsi, qword ptr [rsp + 72]
        test    rsi, rsi
        jne     .LBB16_8
        jmp     .LBB16_9
```
This code is probably not very hot, but there is no reason to leave such a low hanging fruit.
fix the span in the suggestion of remove question mark

Fixes rust-lang#114392

Use a more precise span.
…=wesleywiser

Temporary remove myself from review rotation

I'm going on vacation from 7-th to 15-th and won't be reviewing PRs or writing code.

Feel free to still ping me if you want, I'll read everything when I'm back, but most likely not sooner =)
… r=ozkanonur

Skip checking of `rustc_codegen_gcc` with vendoring enabled

`rustc_codegen_gcc` currently cannot be vendored, which [breaks](rust-lang#112393) `x.py check` with vendoring enabled. Until the vendoring issue is resolved, it would be nice if `x.py check` could succeed (and just skip `gcc`) with `vendor = true`. With this PR, it does.

Related issue: rust-lang#112393

r? bootstrap
@rustbot rustbot added A-meta Area: Issues about the rust-lang/rust repository. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 3, 2023
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Aug 3, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Aug 3, 2023

📌 Commit c0c911b has been approved by matthiaskrgr

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 Aug 3, 2023
@bors
Copy link
Contributor

bors commented Aug 3, 2023

⌛ Testing commit c0c911b with merge 474709a...

@bors
Copy link
Contributor

bors commented Aug 3, 2023

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 474709a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 3, 2023
@bors bors merged commit 474709a into rust-lang:master Aug 3, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 3, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#113657 Expand, rename and improve incorrect_fn_null_checks lint a221807026a8bf86083754ae67b5eb9da90bec61 (link)
#114237 parser: more friendly hints for handling async move in th… 7677dca58b041e475ad13c045ed4a660345dc477 (link)
#114300 Suggests turbofish in patterns ce3fc0a97c6a602a87803152a62e6d15f950b3b9 (link)
#114372 const validation: point at where we found a pointer but exp… 134ee3486207f754538755db784e72e2003cb8f0 (link)
#114395 [rustc_span][perf] Hoist lookup sorted by words out of the … 568cfce3dbf640e42c2d7cdfd44d4b947fe82bc5 (link)
#114403 fix the span in the suggestion of remove question mark 29f06588027394d38da8d6ac954b6dd0f506ad75 (link)
#114408 Temporary remove myself from review rotation a4286113609548be28465889774389e6cee181e9 (link)
#114415 Skip checking of rustc_codegen_gcc with vendoring enabled 858aad58940e2c89d9ce91ed81db97b48832807c (link)

previous master: defed6257a

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (474709a): 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)
-0.3% [-0.3%, -0.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)
1.7% [1.5%, 1.8%] 4
Improvements ✅
(primary)
-2.5% [-2.5%, -2.4%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.5% [-2.5%, -2.4%] 2

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: 648.379s -> 649.938s (0.24%)

@matthiaskrgr matthiaskrgr deleted the rollup-cegblvo branch March 16, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues about the rust-lang/rust repository. merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.