summary refs log tree commit diff
path: root/src/test/mir-opt
AgeCommit message (Collapse)AuthorLines
2021-03-18Mark early otherwise optimization unsoundSantiago Pastorino-2/+2
2021-03-17Auto merge of #82122 - bstrie:dep4real, r=dtolnaybors-15/+15
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes #82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
2021-03-14bless tests (32-bit)Erik Desjardins-25/+17
2021-03-13bless testsErik Desjardins-27/+17
2021-03-13Move ZST check inside UsedLocalsSimon Vandel Sillesen-0/+1
2021-03-13Extend SimplifyLocals to remove ZST writesSimon Vandel Sillesen-37/+11
2021-03-09Deprecate items that accidentally weren't deprecatedbstrie-15/+15
Fixes #82080
2021-03-09Allow calling *const methods on *mut valuesÖmer Sinan Ağacan-0/+116
Fixes #80258
2021-03-06Disable destination propagation on all mir-opt-levelsTomasz Miąsko-147/+255
2021-03-05Bump mir-opt-level from 2 to 3 in testsSantiago Pastorino-5/+5
2021-03-05Bump mir-opt-level from 3 to 4 in testsSantiago Pastorino-9/+9
2021-02-28Remove storage markers if they won't be used during code generationTomasz Miąsko-0/+126
The storage markers constitute a substantial portion of all MIR statements. At the same time, for builds without any optimizations, the storage markers have no further use during and after MIR optimization phase. If storage markers are not necessary for code generation, remove them.
2021-02-22New mir-opt pass to simplify gotos with const valuesSimon Vandel Sillesen-355/+482
Fixes #77355
2021-02-21New pass to deduplicate blocksSimon Vandel Sillesen-1/+115
2021-02-21Make MatchBranchSimplification clean up after itselfSimon Vandel Sillesen-246/+222
2021-02-14Apply suggestionsBenoît du Garreau-63/+95
- Move `assert_failed` to core::panicking` - Make `assert_failed` use an enum instead of a string
2021-02-14Apply suggestionBenoît du Garreau-7/+13
2021-02-14Fix UI tests and merge `assert_eq` and `assert_ne` internal functionsBenoît du Garreau-642/+114
2021-02-06path trimming: ignore type aliasesDan Aloni-31/+31
2021-02-06Rollup merge of #81753 - tmiasko:inline-instruction-set, r=oli-obkMara Bos-0/+146
Never MIR inline functions with a different instruction set
2021-02-04Revert "Simplify unscheduling of drops after moves"Felix S. Klock II-18/+55
This reverts commit b766abc88f78f36193ddefb1079dbc832346b358.
2021-02-04Revert "Use `record_operands_moved` more aggresively"Felix S. Klock II-99/+187
This reverts commit 7f3e8551dde7f14641618cdb8fda2f99ff1d74b6.
2021-02-04Revert "Avoid leaking block expression values"Felix S. Klock II-15/+10
This reverts commit 4fef39113a514bb270f5661a82fdba17d3e41dbb.
2021-02-05Never MIR inline functions with a different instruction setTomasz Miąsko-0/+146
2021-02-01Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkovbors-320/+320
Implement Rust 2021 panic This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007. It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller. This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: https://github.com/rust-lang/rust/pull/80879/commits/c5273bdfb266c35e8eab9413aa8d58d27fdbe114 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.
2021-01-25Implement new panic!() behaviour for Rust 2021.Mara Bos-320/+320
2021-01-25Ignore a test on wasm, because that changes landing padsoli-37/+39
2021-01-23Move test to mir-opt so we actually see that no inlining is happeningoli-0/+108
2021-01-23Prevent query cycles during inliningoli-0/+69
2021-01-18Remove disabled transformation from instcombineTomasz Miąsko-70/+1
2021-01-15Add test for #59352Dániel Buga-0/+121
2021-01-14Auto merge of #79328 - c410-f3r:hir-if, r=matthewjasperbors-464/+421
Reintroduce hir::ExprKind::If Basically copied and paste #59288/https://github.com/rust-lang/rust-clippy/pull/4080 with some modifications. The vast majority of tests were fixed and now there are only a few remaining. Since I am still unable to figure out the missing pieces, any help with the following list is welcome. - [ ] **Unnecessary `typeck` exception**: [Cheated on this one to make CI green.](https://github.com/rust-lang/rust/pull/79328/files#diff-3faee9ba23fc54a12b7c43364ba81f8c5660045c7e1d7989a02a0cee1c5b2051) - [x] **Incorrect span**: [Span should reference `then` and `else` separately.](https://github.com/rust-lang/rust/pull/79328/files#diff-cf2c46e82222ee4b1037a68fff8a1af3c4f1de7a6b3fd798aacbf3c0475abe3d) - [x] **New note regarding `assert!`**: [Modified but not "wrong". Maybe can be a good thing?](https://github.com/rust-lang/rust/pull/79328/files#diff-9e0d7c89ed0224e2b62060c957177c27db43c30dfe3c2974cb6b5091cda9cfb5) - [x] **Inverted report location**: [Modified but not "wrong". Locations were inverted.](https://github.com/rust-lang/rust/pull/79328/files#diff-f637ce7c1f68d523a165aa9651765df05e36c4d7d279194b1a6b28b48a323691) - [x] **`src/test/ui/point-to-type-err-cause-on-impl-trait-return.rs` has weird errors**: [Not sure why this is happening.](https://github.com/rust-lang/rust/pull/79328/files#diff-c823c09660f5b112f95e97e8ff71f1797b6c7f37dbb3d16f8e98bbaea8072e95) - [x] **Missing diagnostic**: [???](https://github.com/rust-lang/rust/pull/79328/files#diff-6b8ab09360d725ba4513933827f9796b42ff9522b0690f80b76de067143af2fc)
2021-01-09Bless profile targetsCaio-17/+12
2021-01-07Reintroduce hir::ExprKind::IfCaio-447/+409
2021-01-04Keep an unoptimized duplicate of `const fn` aroundoli-46/+46
This allows CTFE to reliably detect UB, as otherwise optimizations may hide UB.
2021-01-04Stop optimizing promotedsoli-62/+62
2020-12-29Make forget intrinsic safeTomasz Miąsko-16/+10
2020-12-25Rollup merge of #79999 - hencrice:yenlinc/79799, r=oli-obkDylan DPC-27/+0
Refactored verbose print into a function Also handle Tuple and Array separately, which was not explicitly checked. Fixes #79799.
2020-12-23Addressed feedbacksYenlin Chen-27/+0
Also updated the mir-opt test output files.
2020-12-17Rollup merge of #80040 - tmiasko:always-lower-intrinsics, r=Dylan-DPCGuillaume Gomez-0/+28
Always run intrinsics lowering pass Move intrinsics lowering pass from the optimization phase (where it would not run if -Zmir-opt-level=0), to the drop lowering phase where it runs unconditionally. The implementation of those intrinsics in code generation and interpreter is unnecessary. Remove it.
2020-12-15Fixed conflict with drop elaboration and coverageRich Kadel-7/+7
See https://github.com/rust-lang/rust/issues/80045#issuecomment-745733339 Coverage statements are moved to the beginning of the BCB. This does also affect what's counted before a panic, changing some results, but I think these results may even be preferred? In any case, there are no guarantees about what's counted when a panic occurs (by design).
2020-12-15Auto merge of #73210 - wesleywiser:consts_in_debuginfo, r=oli-obkbors-0/+139
[mir-opt] Allow debuginfo to be generated for a constant or a Place 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-12-14Disable the constant debuginfo promotion pass by defaultWesley Wiser-11/+47
It doesn't work correctly on *-pc-windows-gnu
2020-12-15Always run intrinsics lowering passTomasz Miąsko-0/+28
Move intrinsics lowering pass from the optimization phase (where it would not run if -Zmir-opt-level=0), to the drop lowering phase where it runs unconditionally. The implementation of those intrinsics in code generation and interpreter is unnecessary. Remove it.
2020-12-11Lower `discriminant_value` intrinsicTomasz Miąsko-2/+140
This allows const propagation to evaluate comparisons involving field-less enums using derived implementations of `PartialEq` (after inlining `eq`).
2020-12-09Also generate `StorageDead` in constantsoli-0/+70
2020-12-06[mir-opt] Allow debuginfo to be generated for a constant or a PlaceWesley Wiser-46/+149
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-12-04Avoid leaking block expression valuesMatthew Jasper-10/+15
2020-12-04Use `record_operands_moved` more aggresivelyMatthew Jasper-228/+103
2020-12-03Combination of commitsRich Kadel-26/+26
Fixes multiple issue with counters, with simplification Includes a change to the implicit else span in ast_lowering, so coverage of the implicit else no longer spans the `then` block. Adds coverage for unused closures and async function bodies. Fixes: #78542 Adding unreachable regions for known MIR missing from coverage map Cleaned up PR commits, and removed link-dead-code requirement and tests Coverage no longer depends on Issue #76038 (`-C link-dead-code` is no longer needed or enforced, so MSVC can use the same tests as Linux and MacOS now) Restrict adding unreachable regions to covered files Improved the code that adds coverage for uncalled functions (with MIR but not-codegenned) to avoid generating coverage in files not already included in the files with covered functions. Resolved last known issue requiring --emit llvm-ir workaround Fixed bugs in how unreachable code spans were added.