about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop
AgeCommit message (Collapse)AuthorLines
2023-12-07also print 'immutable' flagRalf Jung-10/+10
2023-12-02Auto merge of #118077 - calebzulawski:sync-portable-simd-2023-11-19, ↵bors-34/+34
r=workingjubilee Portable SIMD subtree update Syncs nightly to the latest changes from rust-lang/portable-simd r? `@rust-lang/libs`
2023-11-26Update std::simd usage and test outputsCaleb Zulawski-34/+34
2023-11-24add track_caller for arith opsbohan-2/+2
2023-10-31Update MIR tests for offset_ofGeorge Bateman-16/+16
2023-10-27Auto merge of #103208 - cjgillot:match-fake-read, r=oli-obk,RalfJungbors-0/+4
Allow partially moved values in match This PR attempts to unify the behaviour between `let _ = PLACE`, `let _: TY = PLACE;` and `match PLACE { _ => {} }`. The logical conclusion is that the `match` version should not check for uninitialised places nor check that borrows are still live. The `match PLACE {}` case is handled by keeping a `FakeRead` in the unreachable fallback case to verify that `PLACE` has a legal value. Schematically, `match PLACE { arms }` in surface rust becomes in MIR: ```rust PlaceMention(PLACE) match PLACE { // Decision tree for the explicit arms arms, // An extra fallback arm _ => { FakeRead(ForMatchedPlace, PLACE); unreachable } } ``` `match *borrow { _ => {} }` continues to check that `*borrow` is live, but does not read the value. `match *borrow {}` both checks that `*borrow` is live, and fake-reads the value. Continuation of ~https://github.com/rust-lang/rust/pull/102256~ ~https://github.com/rust-lang/rust/pull/104844~ Fixes https://github.com/rust-lang/rust/issues/99180 https://github.com/rust-lang/rust/issues/53114
2023-10-24Use `PlaceMention` for match scrutinees.Camille GILLOT-0/+4
2023-10-24Tweak test to avoid platform dependency.Camille GILLOT-15/+15
2023-10-21Use a ConstValue instead.Camille GILLOT-179/+555
2023-10-21Generate ValTrees in DataflowConstProp.Camille GILLOT-44/+136
2023-10-19FileCheck transmute.Camille GILLOT-1/+22
2023-10-19Allow to run filecheck in mir-opt tests.Camille GILLOT-0/+23
2023-10-16Stop trying to preserve pretty-printing.Camille GILLOT-20/+20
2023-10-16Rebless.Camille GILLOT-4/+4
2023-10-16Normalize alloc-id in tests.Camille GILLOT-68/+68
2023-10-04Remove mir::LocalDecl::internal.Camille GILLOT-0/+4
2023-09-20Ignore debug-assertions in test.Camille GILLOT-0/+1
2023-09-20Do not create a DerefLen place for `Box<[T]>`.Camille GILLOT-0/+952
2023-09-11Duplicate output for test.Camille GILLOT-0/+491
2023-09-11Support CopyForDeref.Camille GILLOT-4/+8
2023-09-11Handle reading statics.Camille GILLOT-2/+190
2023-09-11Support non-scalar constants.Camille GILLOT-12/+122
2023-09-07Add test where slice is a const.Camille GILLOT-17/+136
2023-09-06Propagate PlaceElem::Index.Camille GILLOT-16/+32
2023-09-06Support array length.Camille GILLOT-0/+690
2023-09-06Implement algebraic simplifications.Camille GILLOT-0/+71
2023-09-06Support a few more rvalues.Camille GILLOT-0/+780
2023-08-30lower ExprKind::Use, LogicalOp::Or and UnOp::NotDing Xiang Fei-4/+6
Co-authored-by: Abdulaziz Ghuloum <aghuloum@gmail.com>
2023-06-23Bless testsGary Guo-11/+11
2023-06-15Remove comments from mir-opt MIR dumpsBen Kimock-721/+697
2023-06-12bless mir-optPietro Albini-0/+268
To reproduce the changes in this commit locally: - Run `./x test tidy` and remove all the output files not associated with a test file anymore, as reported by tidy. - Run `./x test tests/mir-opt --bless` to generate the new outputs.
2023-06-12properly mark tests that require panic=abortPietro Albini-5/+5
2023-04-06Ignore many tests on wasm32Gary Guo-5/+10
2023-02-23Rollup merge of #108208 - cjgillot:flood-enum, r=oli-obkMatthias Krüger-2/+102
Correctly handle aggregates in DataflowConstProp The previous implementation from https://github.com/rust-lang/rust/pull/107411 flooded target of an aggregate assignment with `Bottom`, corresponding to the `deinit` that the interpreter does. As a consequence, when assigning `target = Enum::Variant#i(...)` all the `(target as Variant#j)` were at `Bottom` while they should have been `Top`. This PR replaces that flooding with `Top`. Aside, it corrects a second bug where the wrong place would be used to assign to enum variant fields, resulting to nothing happening. Fixes https://github.com/rust-lang/rust/issues/108166
2023-02-18Remove overflow checks from ConstProp.Camille GILLOT-13/+22
2023-02-18Use the correct place for enum variants.Camille GILLOT-2/+4
2023-02-18Flood aggregate assignments with `Top`.Camille GILLOT-2/+1
2023-02-18Add mir-opt test.Camille GILLOT-0/+99
2023-02-16Auto merge of #107449 - saethlin:enable-copyprop, r=oli-obkbors-5/+7
Enable CopyProp r? `@tmiasko` `@rustbot` label +A-mir-opt
2023-02-15Rollup merge of #107411 - cjgillot:dataflow-discriminant, r=oli-obkDylan DPC-10/+77
Handle discriminant in DataflowConstProp cc ``@jachris`` r? ``@JakobDegen`` This PR attempts to extend the DataflowConstProp pass to handle propagation of discriminants. We handle this by adding 2 new variants to `TrackElem`: `TrackElem::Variant` for enum variants and `TrackElem::Discriminant` for the enum discriminant pseudo-place. The difficulty is that the enum discriminant and enum variants may alias each another. This is the issue of the `Option<NonZeroUsize>` test, which is the equivalent of https://github.com/rust-lang/unsafe-code-guidelines/issues/84 with a direct write. To handle that, we generalize the flood process to flood all the potentially aliasing places. In particular: - any write to `(PLACE as Variant)`, either direct or through a projection, floods `(PLACE as OtherVariant)` for all other variants and `discriminant(PLACE)`; - `SetDiscriminant(PLACE)` floods `(PLACE as Variant)` for each variant. This implies that flooding is not hierarchical any more, and that an assignment to a non-tracked place may need to flood a tracked place. This is handled by `for_each_aliasing_place` which generalizes `preorder_invoke`. As we deaggregate enums by putting `SetDiscriminant` last, this allows to propagate the value of the discriminant. This refactor will allow to make https://github.com/rust-lang/rust/pull/107009 able to handle discriminants too.
2023-02-13Clearly document intentional UB in mir-opt testsBen Kimock-2/+9
Co-authored-by: Jakob Degen <jakob.e.degen@gmail.com>
2023-02-12Enable CopyProp by default, tune the impl a bitBen Kimock-5/+7
2023-02-06Handle discriminants in dataflow-const-prop.Camille GILLOT-10/+77
2023-02-02Bless tests.Camille GILLOT-16/+7
2023-02-02Stop deaggregating enums in MIR.Camille GILLOT-3/+1
2023-01-31Remove both StorageLive and StorageDead in CopyProp.Camille GILLOT-2/+0
2023-01-27Do not merge locals that have their address taken.Camille GILLOT-0/+2
2023-01-27Implement SSA CopyProp pass.Camille GILLOT-10/+0
2023-01-11Move /src/test to /testsAlbert Larsan-0/+907