| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Fixes: #84018
With `-Z instrument-coverage`, coverage reporting of dead blocks
(for example, blocks dropped because a conditional branch is dropped,
based on const evaluation) is now supported.
Note, this PR relands an earlier, reverted PR that failed when compiling
generators. The prior issues with generators has been resolved and a new
test was added to prevent future regressions.
Check out the resulting changes to test coverage of dead blocks in the
test coverage reports in this PR.
|
|
r=tmandry"
This reverts commit e5f83d24aee866a14753a7cedbb4e301dfe5bef5, reversing
changes made to ac888e8675182c703c2cd097957878faf88dad94.
|
|
Fixes: #84018
With `-Z instrument-coverage`, coverage reporting of dead blocks
(for example, blocks dropped because a conditional branch is dropped,
based on const evaluation) is now supported.
If `instrument-coverage` is enabled, `simplify::remove_dead_blocks()`
finds all dropped coverage `Statement`s and adds their `code_region`s as
`Unreachable` coverage `Statement`s to the `START_BLOCK`, so they are
still included in the coverage map.
Check out the resulting changes in the test coverage reports in this PR.
|
|
Remove assignments to ZST places instead of marking ZST return place as unused
partially reverts #83118
requested by `@tmiasko` in https://github.com/rust-lang/rust/pull/83118#issuecomment-799692574
r? `@oli-obk`
|
|
|
|
|
|
`_local` isn't visited in `_local = <rhs>` statements in the situation
we care about
|
|
|
|
|
|
|
|
New mir-opt pass to simplify gotos with const values (reopening #77486)
Reopening PR #77486
Fixes #77355
This pass optimizes the following sequence
```rust
bb2: {
_2 = const true;
goto -> bb3;
}
bb3: {
switchInt(_2) -> [false: bb4, otherwise: bb5];
}
```
into
```rust
bb2: {
_2 = const true;
goto -> bb5;
}
```
|
|
use PlaceRef abstractions more consistently
Addresses this [comment](https://github.com/rust-lang/rust/pull/80865/files#r558978715)
Associated issue: #80647
r? ```@RalfJung```
|
|
Fixes #77355
|
|
|
|
Use `reachable_as_bitset` to reuse a bitset from the traversal rather
than allocating it seprately. Additionally check if there are any
unreachable blocks before proceeding.
|
|
|
|
|
|
Update affected ui & incremental tests to use a user declared variable
bindings instead of temporaries. The former are preserved because of
debuginfo, the latter are not.
|
|
No functionl changes intended.
|
|
The simplify locals implementation uses two different visitors to update
the locals use counts. The DeclMarker calculates the initial use counts.
The StatementDeclMarker updates the use counts as statements are being
removed from the block.
Replace them with a single visitor that can operate in either mode,
ensuring consistency of behaviour.
Additionally use exhaustive match to clarify what is being optimized.
No functional changes intended.
|
|
|
|
|
|
|
|
|