| Age | Commit message (Collapse) | Author | Lines |
|
Change `rustc_codegen_ssa`'s `atomic_cmpxchg` interface to return a pair of values
Doesn't change much, but a little nicer that way.
|
|
Shrink span encoding further
Spans are now stored in a more compact form which cuts down on at least 1 byte per span (indirect/direct encoding) and at most 3 bytes per span (indirect/direct encoding, context byte, length byte). As a result, libcore metadata shrinks by 1.5MB.
I'm not a huge fan of the fairly manual encoding/decoding from bits implemented here. Something like Tokio's pack abstraction (https://github.com/tokio-rs/tokio/blob/master/tokio/src/util/bit.rs) might be desirable to cut down on some of the shifting etc. We might also say that this isn't worth doing :)
I took a look at copying the span encoding we use in memory (described [here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_span/src/span_encoding.rs)). I think the format there makes a lot more sense for in-memory storage where prioritizing a fixed length (i.e., 4 or 8 bytes) is much more important. In metadata, it's much easier for us to have variable-length values, so there's less of a cliff if we don't quite fit. The bit packing scheme there would need changes to fit the varint scheme since it has a lot of all-1s patterns as the "relative offset" form.
|
|
Implement constant propagation on top of MIR SSA analysis
This implements the idea I proposed in https://github.com/rust-lang/rust/pull/110719#issuecomment-1718324700
Based on https://github.com/rust-lang/rust/pull/109597
The value numbering "GVN" pass formulates each rvalue that appears in MIR with an abstract form (the `Value` enum), and assigns an integer `VnIndex` to each. This abstract form can be used to deduplicate values, reusing an earlier local that holds the same value instead of recomputing. This part is proposed in #109597.
From this abstract representation, we can perform more involved simplifications, for example in https://github.com/rust-lang/rust/pull/111344.
With the abstract representation `Value`, we can also attempt to evaluate each to a constant using the interpreter. This builds a `VnIndex -> OpTy` map. From this map, we can opportunistically replace an operand or a rvalue with a constant if their value has an associated `OpTy`.
The most relevant commit is [Evaluated computed values to constants.](https://github.com/rust-lang/rust/commit/2767c4912ea249c2f613a9cedcd6c13ea1237e54)"
r? `@oli-obk`
|
|
Spans are now stored in a more compact form which cuts down on at least
1 byte per span (indirect/direct encoding) and at most 3 bytes per span
(indirect/direct encoding, context byte, length byte). As a result,
libcore metadata shrinks by 1.5MB.
|
|
Rollup of 5 pull requests
Successful merges:
- #119322 (Couple of random coroutine pass simplifications)
- #119374 (Italicise "bytes" in the docs of some `Vec` methods)
- #119388 (rustc_lint: Prevent triplication of various lints)
- #119406 (Add non-regression test for ATPIT ICE #114325)
- #119410 (Rename test to be more descriptive)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Rename test to be more descriptive
As suggested in https://github.com/rust-lang/rust/pull/119402#discussion_r1438171079
r? ``@Nilstrieb``
|
|
Add non-regression test for ATPIT ICE #114325
ATPIT issue #114325 had been unknowingly fixed by https://github.com/rust-lang/rust/pull/107421, so this PR adds its [MCVE](https://github.com/rust-lang/rust/issues/114325#issuecomment-1721561552) as a non-regression test.
Closes #114325.
|
|
rustc_lint: Prevent triplication of various lints
Prevent triplication of various lints. The triplication happens because we run the same lint three times (or less in some cases):
* In `BuiltinCombinedPreExpansionLintPass`
* In `BuiltinCombinedEarlyLintPass`
* In `shallow_lint_levels_on()`
Only run the lints one time by checking the `lint_added_lints` bool.
Set your GitHub diff setting to ignore whitespaces changes when reviewing this PR, since I had to enclose a block inside an if.
Closes #73301
(I found this while exploring the code related to [this](https://github.com/rust-lang/rust/pull/119251#discussion_r1435677330) comment.)
|
|
Italicise "bytes" in the docs of some `Vec` methods
On a cursory read it's easy to miss that the limit is in terms of bytes not no. of elements. The italics should help with that.
Fixes #119149
|
|
Couple of random coroutine pass simplifications
Just aesthetic changes, except for a random `Ty::new_task_context(tcx)` call that was redundant.
|
|
fix: correct the args for `disambiguate the associated function` diagnostic
This is somehow silimar to https://github.com/rust-lang/rust/pull/118502, we shouldn't take receiver as first arg all the cases.
close https://github.com/rust-lang/rust/issues/118819
|
|
Remove usage of deprecated `missing-tools` bootstrap flag
This PR removes the usage of `--enable-missing-tools` in CI, as this config option is no longer used. It also removes `dist.missing-tools` config completely.
Let me know which commits should I remove (if any).
Fixes: https://github.com/rust-lang/rust/issues/79249
r? `@onur-ozkan`
|
|
Only store StableCrateId once in DefPathTable.
https://github.com/rust-lang/rust/pull/119238 made me think of this.
cc `@Mark-Simulacrum`
|
|
|
|
Clippy subtree update
r? `@Manishearth`
|
|
Rollup of 5 pull requests
Successful merges:
- #119375 (Merge Coroutine lowering functions)
- #119393 (Use filter instead of filter_map in Parser::expected_one_of_not_found)
- #119401 (coverage: Avoid a possible query stability hazard in `CoverageCounters`)
- #119402 (Also walk bindings created by if-let guards)
- #119404 (Enable profiler in dist-powerpc-linux)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Enable profiler in dist-powerpc-linux
|
|
Also walk bindings created by if-let guards
This change makes the `unused_variables` lint pick up unused bindings created by if-let guards.
Fixes #119383
|
|
coverage: Avoid a possible query stability hazard in `CoverageCounters`
#119252 revealed a possible query stability hazard in `CoverageCounters`: we iterate over the entries of an `FxHashMap` in a way that allows the iteration order to potentially affect the relative creation order of MIR blocks.
I'm not sure whether there's an actual stability problem or not in practice, but it's certainly a hazard, and I don't see any reason not to switch over to `FxIndexMap` to avoid potential issues.
---
This can either be merged on its own, or incorporated into #119252.
cc `@Enselic`
r? `@cjgillot`
|
|
Use filter instead of filter_map in Parser::expected_one_of_not_found
|
|
Merge Coroutine lowering functions
Instead of having separate `make_async/etc_expr` functions, this merges them them into one, reducing code duplication a bit.
|
|
|
|
|
|
because on a cursory read it's easy to miss that the limit is
in terms of bytes not no. of elements. The italics should help
with that.
|
|
make `ClosureArgsParts` and `CoroutineArgsParts` not generic
I hope a few extra calls to `expect_ty` will not affect perf...
|
|
|
|
Use `Pat::walk_always` instead of manual walk
It's also a bit faster, but I doubt that it will have a noticeable perf impact. Mostly doing it because it's shorter and nicer.
|
|
The iteration order of this hashmap can potentially affect the relative
creation order of MIR blocks.
|
|
|
|
utilize the unused `llvm-tools` option
This field was not functioning as described in its comment in `config.example.toml`. Also, updated the default value to `true` to keep the bootstrapping behavior as it was before.
cc `@Zalathar`
|
|
|
|
Remove movability from `TyKind::Coroutine`
There's no reason to store movability in the generator struct directly. It is computed from the HIR, and can be pulled into a query to access when necessary.
|
|
Instead of having separate `make_async/etc_expr` functions, this merges them them into one, reducing code duplication a bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Prevent multiple 'ignored unless specified at crate level' lints. The
multiplication happens because we run the same lint three times:
* In BuiltinCombinedEarlyLintPass
* In BuiltinCombinedPreExpansionLintPass
* In shallow_lint_levels_on
Only run the lint one time by checking the `lint_added_lints` bool.
|
|
So we can apply more kinds of lints to added lints without having to add
another parameter.
|
|
|
|
|
|
|
|
Rustup
r? `@ghost`
changelog: none
|
|
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #119331 (rustdoc-search: count path edits with separate edit limit)
- #119359 (Simplify Parser::ident_or_error)
- #119376 (Add regression test for #106630)
- #119379 (Update `parse_seq` doc)
- #119380 (Don't suggest writing a bodyless arm if the pattern can never be a never pattern)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Don't suggest writing a bodyless arm if the pattern can never be a never pattern
#118527 enabled arms to be bodyless for never patterns ; this PR removes the `,` and `}` suggestions for patterns that could never be never patterns.
|