about summary refs log tree commit diff
path: root/src/test/mir-opt
AgeCommit message (Collapse)AuthorLines
2019-08-15ignore tests on wasm32-bareRalf Jung-0/+1
2019-08-15test Retag in drop shimRalf Jung-11/+26
2019-08-02const_prop no longer does ptr-to-int castsRalf Jung-1/+1
2019-07-28Use new 'p @ ..' syntax in tests.Mazdak Farrokhzad-1/+1
2019-07-20Remove tests for -Zlower-128bit-opsbjorn3-375/+0
2019-07-14Auto merge of #62331 - wesleywiser:fix_early_return_leak, r=matthewjasperbors-0/+91
Fix leak when early returning out of `box` syntax Fixes #62289 r? @matthewjasper
2019-07-11Fix leak when early returning out of `box` syntaxWesley Wiser-0/+91
Fixes #62289
2019-07-07Only omit StorageLive/Dead for variable that are never initializedMatthew Jasper-0/+1
With `feature(never_type)`, it's not guaranteed that any variable with type `!` isn't ever assigned to.
2019-07-06Bless mir-opt/while-storage.rs.Mazdak Farrokhzad-24/+21
2019-06-25Add StorageDead statements for `while` conditionsMatthew Jasper-25/+84
2019-06-25Use `as_temp` to evaluate statement expressionsMatthew Jasper-6/+27
2019-06-13Add a test for simple matchesMatthew Jasper-0/+39
2019-06-13Create fewer basic blocks in match MIR loweringMatthew Jasper-291/+220
2019-06-07Rollup merge of #61532 - wesleywiser:const_prop_more, r=oli-obkMazdak Farrokhzad-18/+68
[const-prop] Support Rvalue::{Ref,Len} and Deref Also fixes an ICE I found in testing. r? @oli-obk ~~The final commit is just for a perf run. I'll remove it after that is completed.~~
2019-06-06Don't run MIR passes on constructor shimsMatthew Jasper-1/+2
2019-06-06[const-prop] Handle Rvalue::LenWesley Wiser-18/+22
2019-06-06[const-prop] Handle ProjectionElem::DerefWesley Wiser-0/+21
2019-06-06[const-prop] Fix ICE when casting function pointersWesley Wiser-0/+25
This fixes an ICE when building libcore with `-Z mir-opt-level=3`.
2019-06-05Test StorageDead statements explicitlyTyler Mandry-0/+106
2019-06-03Add const-eval support for indirectsChristian Poveda-2/+26
2019-05-25Fix tidyOliver Scherer-0/+1
2019-05-25Print generic args in function calls in MIROliver Scherer-5/+5
2019-05-25`u8` is printed as a number, not a characterOliver Scherer-1/+1
2019-05-25Render const byte slices in MIROliver Scherer-1/+1
2019-05-25Add test showing how byte slices are printed in MIROliver Scherer-0/+15
2019-05-23Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelixbors-104/+372
Add match arm scopes and other scope fixes * Add drop and lint scopes for match arms. * Lint attributes are now respected on match arms. * Make sure we emit a StorageDead if we diverge when initializing a temporary. * Adjust MIR pretty printing of scopes for locals. * Don't generate duplicate lint scopes for `let statements`. * Add some previously missing fake borrows for matches. closes #46525 cc @rust-lang/compiler
2019-05-22Auto merge of #60840 - tmandry:preserve-scope-in-generator-mir, r=cramertjbors-0/+1
Preserve local scopes in generator MIR Part of #52924, depended upon by the generator layout optimization #60187. This PR adds `StorageDead` statements in more places in generators, so we can see when non-`Drop` locals have gone out of scope and recover their storage. The reason this is only done for generators is compiler performance. See https://github.com/rust-lang/rust/pull/60187#issuecomment-485637811 for what happens when we do this for all functions. For `Drop` locals, we modify the `MaybeStorageLive` analysis to use `drop` to indicate that storage is no longer live for the local. Once `drop` returns or unwinds to our function, we implicitly assume that the local is `StorageDead`. Instead of using `drop`, it is possible to emit more `StorageDead` statements in the MIR for `Drop` locals so we can handle all locals the same. I am fine with doing it that way, but this was the simplest approach for my purposes. It is also likely to be more performant. r? @Zoxc (feel free to reassign) cc @cramertj @eddyb @RalfJung @rust-lang/wg-async-await
2019-05-21Add a test for match scopesMatthew Jasper-0/+245
2019-05-21Schedule storage-dead of temporaries soonerMatthew Jasper-5/+4
This ensures that we will correctly generate a storage-dead if the initializing expression diverges.
2019-05-21Give match arms a drop/region scopeMatthew Jasper-88/+121
Also give arms the correct lint scope in MIR.
2019-05-21Handle the visibility/lint scope distinction betterMatthew Jasper-14/+5
* Don't generate an extra lint scope for each `let` statement. * Place match guards inside the visiblility scope of the bindings for their arm.
2019-05-19[const-prop] Support propagating into SwitchInt's `discr` OperandWesley Wiser-4/+42
2019-05-19[const-prop] Support propagating into Assert's `cond` OperandWesley Wiser-2/+2
2019-05-17Auto merge of #60171 - matthewjasper:full-nll-compare-mode, r=pnkfelixbors-2/+0
Use -Zborrowck=mir for NLL compare mode closes #56993 r? @pnkfelix
2019-05-16Rollup merge of #60597 - wesleywiser:const_prop, r=oli-obkManish Goregaokar-0/+125
Do some simple constant propagation in the ConstProp pass r? @oli-obk I added a few test cases. Let me know if you think there should be more.
2019-05-15Add test to ensure const-prop fails gracefullyWesley Wiser-0/+34
2019-05-15Add some tests for constant propagationWesley Wiser-0/+91
The results aren't ideal but they represent the current state.
2019-05-14Emit StorageDead for all locals in generatorsTyler Mandry-0/+1
2019-05-12Remove feature(nll) when compare mode is sufficientMatthew Jasper-2/+0
2019-05-10Adjust mir-opt tests for new HIR without IfMazdak Farrokhzad-21/+26
2019-05-09Rollup merge of #59348 - matthewjasper:cleanup-drop-shims, r=arielb1Mazdak Farrokhzad-0/+88
Clean up and add tests for slice drop shims Adds a test for the MIR generated by `real_drop_in_place::<[T]>`. Also slightly reduces the number of statements and locals used in the shim. r? @RalfJung
2019-05-09cleanup: Remove `DefIndexAddressSpace`Vadim Petrochenkov-4/+4
2019-05-04Rollup merge of #60516 - JohnTitor:remove-typeck, r=matthewjasperMazdak Farrokhzad-2/+2
Remove TypeckMir Fixes #60422 r? @matthewjasper
2019-05-04Auto merge of #59897 - tmandry:variantful-generators, r=eddybbors-1/+2
Multi-variant layouts for generators This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants. Required for optimizing generator layouts (#52924). There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible. This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator. Also, fixes #59972. Future work: - Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924) - In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172) - Preserve debuginfo scopes across generator yield points
2019-05-04Fix testYuki Okushi-2/+2
2019-05-01Slightly simplify the MIR for slice drop shimsMatthew Jasper-38/+34
2019-05-01Add test for slice drop shimsMatthew Jasper-0/+92
2019-04-25Support variantful generatorsTyler Mandry-1/+2
This allows generators to overlap fields using variants.
2019-04-24Evaluate hair::ExprKind::Use in intoMatthew Jasper-18/+17
This avoids some unnecessary moves
2019-04-24Rollup merge of #56278 - eddyb:mir-debuginfo-proof, r=nikomatsakisMazdak Farrokhzad-27/+27
Future-proof MIR for dedicated debuginfo. This is #56231 without the last commit (the one that actually moves to `VarDebuginfo`). Nothing should be broken, but it should no longer depend on debuginfo for anything else. r? @nikomatsakis