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 6 pull requests #127076

Merged
merged 23 commits into from
Jun 28, 2024
Merged

Rollup of 6 pull requests #127076

merged 23 commits into from
Jun 28, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

onur-ozkan and others added 23 commits June 24, 2024 22:04
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
`-Z patchable-function-entry` works like `-fpatchable-function-entry`
on clang/gcc. The arguments are total nop count and function offset.

See MCP rust-lang/compiler-team#704
See [RFC](https://github.com/maurer/rust-rfcs/blob/patchable-function-entry/text/0000-patchable-function-entry.md) (yet to be numbered)

TODO before submission:
* Needs an RFC
* Improve error reporting for malformed attributes
Removes an `unsafe` in favor of just using `String` methods.
Co-authored-by: Ralf Jung <post@ralfj.de>
Currently bootstrap doesn't use any inner paths from rust-analyzer and
bootstrap with `ShouldRun::create_or_deps`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
…s-pr, r=estebank,workingjubilee

patchable-function-entry: Add unstable compiler flag and attribute

Tracking issue: rust-lang#123115

Add the -Z patchable-function-entry compiler flag and the #[patchable_function_entry(prefix_nops = m, entry_nops = n)] attribute.
Rebased and adjusted the canditate implementation to match changes in the RFC.
…e, r=Kobzol

make cargo submodule optional

Right now, we fetch the cargo submodule no matter what, even if the command we are running doesn't need it (e.g., `x build compiler library`). This PR changes that to only fetch the cargo submodule when it's necessary.

For more context, see the zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Why.20is.20cargo.20always.20checked.20out.3F
core: avoid `extern type`s in formatting infrastructure

```@RalfJung``` [said](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Use.20of.20.60extern.20type.60.20in.20formatting.20machinery/near/446552837):

>How attached are y'all to using `extern type` in the formatting machinery?
Seems like this was introduced a [long time ago](rust-lang@34ef8f5). However, it's also [not really compatible with Stacked Borrows](rust-lang/unsafe-code-guidelines#256), and only works currently because we effectively treat references-to-extern-type almost like raw pointers in Stacked Borrows -- which of course is unsound, it's not how LLVM works. I was planning to make Miri emit a warning when this happens to avoid cases like [this](rust-lang#126814 (comment)) where people use extern type specifically to silence Miri without realizing what happens. but with the formatting machinery using  extern type, this warning would just show up everywhere...
>
> The "proper" way to do this in Stacked Borrows is to use raw pointers (or `NonNull`).

This PR does just that.

r? ```@RalfJung```
… r=cuviper

Simplify `str::clone_into`

Removes an `unsafe` in favor of just using `String` methods.
Support fetching `Attribute` of items.

Fixes [https://github.com/rust-lang/project-stable-mir/issues/83](https://github.com/rust-lang/project-stable-mir/issues/83)

`rustc_ast::ast::Attribute` doesn't impl `Hash` and `Eq`. Thus it cannot be directly used as key of `IndexMap` in `rustc_smir::rustc_smir::Tables` and we cannot define stable `Attribute` as index to `rustc_ast::ast::Attribute` like `Span` and many other stable definitions.

Since an string (or tokens) and its span contain all info about an attribute, I defined a simple `Attribute` struct on stable side.

I choose to fetch attributes via `tcx::get_attrs_by_path()` due to `get_attrs()` is marked as deprecated and `get_attrs_by_name()` cannot handle name of multiple segments like `rustfmt::skip`.

r? `@celinval`
…s, r=oli-obk

Tighten `fn_decl_span` for async blocks

Tightens the span of `async {}` blocks in diagnostics, and subsequently async closures and async fns, by actually setting the `fn_decl_span` correctly. This is kinda a follow-up on rust-lang#125078, but it fixes the problem in a more general way.

I think the diagnostics are significantly improved, since we no longer have a bunch of overlapping spans. I'll point out one caveat where I think the diagnostic may get a bit more confusing, but where I don't think it matters.

r? ````@estebank```` or ````@oli-obk```` or someone else on wg-diag or compiler i dont really care lol
@rustbot rustbot added 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) 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jun 28, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Jun 28, 2024

📌 Commit 89a0cfe 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 Jun 28, 2024
@bors
Copy link
Contributor

bors commented Jun 28, 2024

⌛ Testing commit 89a0cfe with merge 99f77a2...

@bors
Copy link
Contributor

bors commented Jun 28, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 99f77a2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 28, 2024
@bors bors merged commit 99f77a2 into rust-lang:master Jun 28, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 28, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#124741 patchable-function-entry: Add unstable compiler flag and at… fd5454ef4c99e6a52f71e7e40a539d35d89049dc (link)
#126470 make cargo submodule optional 29555f5bac2f1222d715f4c3ba933d6f47b54add (link)
#126956 core: avoid extern types in formatting infrastructure 82d7c0e51e74118ab31e03a24aedd8815d3c9ed2 (link)
#126970 Simplify str::clone_into cfc52004a011474c2911dde4d97cf17cada275c3 (link)
#127022 Support fetching Attribute of items. f5ff54af56f597978c57664cd7ad5cd4787b72e8 (link)
#127058 Tighten fn_decl_span for async blocks ee34dfc01aab44659f5c6675156bf4e947e5fea3 (link)

previous master: 42add88d22

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 (99f77a2): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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)
1.4% [0.6%, 2.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-2.7%, -0.8%] 2
Improvements ✅
(secondary)
-0.7% [-6.2%, -0.2%] 17
All ❌✅ (primary) -0.2% [-2.7%, 2.1%] 4

Max RSS (memory usage)

Results (primary -2.3%)

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.6% [2.5%, 2.6%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.9% [-6.2%, -2.6%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.3% [-6.2%, 2.6%] 8

Cycles

Results (primary 1.5%, secondary 2.7%)

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.5% [2.1%, 3.2%] 6
Regressions ❌
(secondary)
2.7% [2.6%, 2.9%] 2
Improvements ✅
(primary)
-1.5% [-2.2%, -0.8%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [-2.2%, 3.2%] 8

Binary size

Results (primary 0.2%, secondary 0.1%)

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.2% [0.0%, 1.2%] 101
Regressions ❌
(secondary)
0.1% [0.0%, 0.4%] 75
Improvements ✅
(primary)
-0.2% [-0.5%, -0.1%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-0.5%, 1.2%] 104

Bootstrap: 697.835s -> 696.308s (-0.22%)
Artifact size: 326.76 MiB -> 326.72 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 28, 2024
@pnkfelix
Copy link
Member

pnkfelix commented Jul 2, 2024

@rust-timer build fd5454e

@rust-timer

This comment has been minimized.

@pnkfelix
Copy link
Member

pnkfelix commented Jul 2, 2024

@rust-timer build cfc5200

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fd5454e): comparison URL.

Overall result: ✅ improvements - no action needed

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

Max RSS (memory usage)

Results (primary 2.4%)

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

Cycles

Results (secondary 5.1%)

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

Binary size

Results (primary 0.0%, secondary 0.2%)

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.0% [0.0%, 0.1%] 34
Regressions ❌
(secondary)
0.2% [0.0%, 0.4%] 21
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 34

Bootstrap: 697.835s -> 696.956s (-0.13%)
Artifact size: 326.76 MiB -> 326.69 MiB (-0.02%)

@pnkfelix
Copy link
Member

pnkfelix commented Jul 3, 2024

@rust-timer build cfc5200

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cfc5200): comparison URL.

Overall result: ✅ improvements - no action needed

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

Max RSS (memory usage)

Results (primary 2.5%)

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

Cycles

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

Binary size

Results (primary -0.0%, secondary -0.0%)

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.0% [-0.0%, -0.0%] 4
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 8
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 4

Bootstrap: 697.835s -> 697.14s (-0.10%)
Artifact size: 326.76 MiB -> 326.68 MiB (-0.02%)

@pnkfelix
Copy link
Member

pnkfelix commented Jul 3, 2024

@rust-timer build 82d7c0e

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (82d7c0e): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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)
1.4% [0.6%, 2.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.7% [-2.8%, -0.7%] 2
Improvements ✅
(secondary)
-0.8% [-7.3%, -0.3%] 19
All ❌✅ (primary) -0.2% [-2.8%, 2.1%] 4

Max RSS (memory usage)

Results (primary -2.9%)

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.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.0% [-6.1%, -2.7%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.9% [-6.1%, 2.6%] 6

Cycles

Results (primary 0.8%)

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.4% [2.1%, 2.8%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.7% [-2.4%, -0.9%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [-2.4%, 2.8%] 5

Binary size

Results (primary 0.2%, secondary 0.1%)

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.2% [0.0%, 1.2%] 70
Regressions ❌
(secondary)
0.1% [0.0%, 0.4%] 55
Improvements ✅
(primary)
-0.2% [-0.5%, -0.1%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-0.5%, 1.2%] 73

Bootstrap: 697.835s -> 693.796s (-0.58%)
Artifact size: 326.76 MiB -> 326.71 MiB (-0.02%)

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. perf-regression Performance regression. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.