about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/simplify_try.rs
AgeCommit message (Collapse)AuthorLines
2021-09-07Move rustc_mir::transform to rustc_mir_transform.Camille GILLOT-795/+0
2021-08-18Remove box syntax from rustc_mirest31-2/+2
2021-06-01Reland - Report coverage `0` of dead blocksRich Kadel-1/+1
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.
2021-05-14Improve match statementsayushmishra2005-4/+1
2021-05-11Revert "Auto merge of #84797 - richkadel:cover-unreachable-statements, ↵Rich Kadel-1/+1
r=tmandry" This reverts commit e5f83d24aee866a14753a7cedbb4e301dfe5bef5, reversing changes made to ac888e8675182c703c2cd097957878faf88dad94.
2021-05-01Report coverage `0` of dead blocksRich Kadel-1/+1
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.
2021-02-21Drive-by formatting of commentSimon Vandel Sillesen-2/+2
2021-01-14Use Option::map_or instead of `.map(..).unwrap_or(..)`LingMan-2/+2
2020-12-23Fix typo in simplify_try.rsIkko Ashimine-1/+1
assigment -> assignment
2020-12-06[mir-opt] Allow debuginfo to be generated for a constant or a PlaceWesley Wiser-14/+27
Prior to this commit, debuginfo was always generated by mapping a name to a Place. This has the side-effect that `SimplifyLocals` cannot remove locals that are only used for debuginfo because their other uses have been const-propagated. To allow these locals to be removed, we now allow debuginfo to point to a constant value. The `ConstProp` pass detects when debuginfo points to a local with a known constant value and replaces it with the value. This allows the later `SimplifyLocals` pass to remove the local.
2020-10-10Refactor how SwitchInt stores jump targetsJonas Schievink-8/+6
2020-10-04Fix miscompile in SimplifyBranchSameSimon Vandel Sillesen-1/+2
2020-10-04Remember the `MirSource` for each `Body`Dylan MacKenzie-4/+6
2020-10-01Disable the SimplifyArmIdentity mir-optWesley Wiser-1/+6
The optimization still has some bugs that need to be worked out such as #77359. We can try re-enabling this again after the known issues are resolved.
2020-09-19Add assertion for len of vecsSimon Vandel Sillesen-3/+4
2020-09-19Fix #76803Simon Vandel Sillesen-23/+33
Check that the variant index matches the target value from the SwitchInt we came from
2020-09-17[mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame optWesley Wiser-2/+9
The logic is currently broken and we need to disable it to fix a beta regression (see #76803)
2020-09-14Auto merge of #76541 - matthiaskrgr:unstable_sort, r=davidtwcobors-2/+2
use sort_unstable to sort primitive types It's not important to retain original order if we have &[1, 1, 2, 3] for example. clippy::stable_sort_primitive
2020-09-10take reference to Place directly instead of taking reference to Box<Place>Matthias Krüger-1/+1
clippy::borrowed_box
2020-09-10use sort_unstable to sort primitive typesMatthias Krüger-2/+2
It's not important to retain original order if we have &[1, 1, 2, 3] for example. clippy::stable_sort_primitive
2020-09-08Auto merge of #76308 - wesleywiser:enable_simplifyarmidentity_mir_opt, r=oli-obkbors-5/+1
Enable the SimplifyArmIdentity MIR optimization at mir-opt-level=1 r? `@ghost`
2020-09-04Change ty.kind to a methodLeSeulArtichaut-1/+1
2020-09-03Enable the SimplifyArmIdentity MIR optimization at mir-opt-level=1Wesley Wiser-5/+1
2020-08-30mv compiler to compiler/mark-0/+765