about summary refs log tree commit diff
path: root/src/test/mir-opt
AgeCommit message (Collapse)AuthorLines
2018-05-04Update mir-opt test to reflect change to MIR code-generation.Felix S. Klock II-53/+61
2018-04-15remove -Znll -- borrowck=mir implies nll nowNiko Matsakis-13/+13
2018-04-12Add some new tests + Fix failing testsVadim Petrochenkov-39/+51
2018-04-05Stabilize attributes on generic parametersVadim Petrochenkov-1/+0
2018-03-26Stabilize i128_typeMark Mansi-2/+0
2018-03-23Updated MIR with UserAssertTy in mir-opt tests.David Wood-2/+5
2018-03-21WIP fix mir-opt-end-region-8Niko Matsakis-2/+4
2018-03-20Stabilize slice patterns without `..`Vadim Petrochenkov-1/+2
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-08Rebase falloutOliver Schneider-1/+1
2018-03-08Produce instead of pointersOliver Schneider-12/+12
2018-02-28Rollup merge of #48355 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakisManish Goregaokar-0/+25
Fixes #47311. r? @nrc
2018-02-25restore Subslice move out from array after elaborate drops and borrowckMikhail Modin-0/+25
2018-02-20rustc_mir: optimize the deaggregator's expansion of statements.Eduard-Mihai Burtescu-11/+15
2018-02-20rustc_mir: don't run the deaggregator on arrays for now.Eduard-Mihai Burtescu-2/+1
2018-02-20rustc_mir: handle all aggregate kinds in the deaggregator.Eduard-Mihai Burtescu-3/+2
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2018-02-17Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakisbors-0/+59
add transform for uniform array move out reworked second step for fix #34708 previous try #46686 r? @nikomatsakis
2018-02-11Auto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakisbors-52/+55
rustc_mir: insert a dummy access to places being matched on, when building MIR. Fixes #47412 by adding a `_dummy = Discriminant(place)` before each `match place {...}`. r? @nikomatsakis
2018-02-09rustc_mir: insert a dummy access to places being matched on, when building MIR.Eduard-Mihai Burtescu-52/+55
2018-02-08add transform for uniform array move outMikhail Modin-0/+59
2018-02-07Fix tests for MIR loop loweringbobtwinkles-0/+49
Fixes the hash test to recognize that MirValidated can change when changing around labels, and add a new test that makes sure we're lowering loop statements correctly.
2018-02-07[ci skip] Generate false edges from loop_blockbobtwinkles-43/+59
As opposed to using weirdness involving pretending the body block is the loop block. This does not pass tests This commit is [ci skip] because I know it doesn't pass tests yet. Somehow this commit introduces nondeterminism into the handling of loops.
2018-02-05mir: Add and fix tests for FalseUnwindsbobtwinkles-19/+29
Fix instructions on existing mir-opt tests after introducing false edges from loops. Also, add a test for issue 46036: infinite loops.
2018-01-29Fix ref-to-ptr coercions not working with NLL in certain casesAaron Hill-3/+6
Implicit coercions from references to pointers were lowered to slightly different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted in certain uses of self-referential structs compiling correctly when an explicit cast was used, but not when the implicit coercion was used. To fix this, this commit adds an outer 'Use' expr when applying a raw-ptr-borrow adjustment. This makes the lowered Mir for coercions identical to that of explicit coercions, allowing the original code to compile regardless of how the raw ptr cast occurs. Fixes #47722
2017-12-30Add trailing newlines to files which have no trailing newlines.kennytm-1/+1
2017-12-20Auto merge of #46862 - nikomatsakis:nll-master, r=arielb1bors-102/+0
NLL feature complete (adds `feature(nll)`)! This is the final PR for the nll-master branch; it brings over all remaining content. The contents of the branch include: - track causal information and use it to report extended errors - handle `impl Trait` in NLL code - improve printing of outlives errors - add `#![feature(nll)]` and some more sample tests The commits should for the most part build independently. r? @pnkfelix (and/or @arielb1)
2017-12-20convert region-liveness-drop{-,-no-}may-dangle.rs into ui testsNiko Matsakis-102/+0
The "match exact bits of CFG" approach was fragile and uninformative.
2017-12-20Auto merge of #46583 - scottmcm:fix-static-i128-lower, r=eddybbors-4/+244
Fix -Z lower_128bit_ops handling of statics Avoids ICEs such as the following: > error: internal compiler error: src\librustc_metadata\cstore_impl.rs:131: > get_optimized_mir: missing MIR for `DefId(8/0:40 ~ > compiler_builtins[9532]::int[0]::addsub[0]::rust_i128_addo[0])` r? @nagisa cc #45676 @est31
2017-12-19Fix -Z lower_128bit_ops handling of staticsScott McMurray-4/+244
Avoids ICEs such as the following: error: internal compiler error: src\librustc_metadata\cstore_impl.rs:131: get_optimized_mir: missing MIR for `DefId(8/0:40 ~ compiler_builtins[9532]::int[0]::addsub[0]::rust_i128_addo[0])`
2017-12-15more concise debug output when dumping the value of a regionNiko Matsakis-21/+21
2017-12-15impose inputs/ouputs on MIR after the factNiko Matsakis-1/+5
The input/output types found in `UniversalRegions` are not normalized. The old code used to assign them directly into the MIR, which would lead to errors when there was a projection in a argument or return type. This also led to some special cases in the `renumber` code. We now renumber uniformly but then pass the input/output types into the MIR type-checker, which equates them with the types found in MIR. This allows us to normalize at the same time.
2017-12-15thread through an implicit region body of the fn bodyNiko Matsakis-26/+32
2017-12-13refactor region value bitmatrixNiko Matsakis-4/+4
2017-12-07add closure requirement tests, improve debugging outputNiko Matsakis-36/+44
The overall format is now easier to read. Also, There is now graphviz output, as well as a `#[rustc_regions]` annotation that dumps internal state.
2017-12-04Auto merge of #46319 - nikomatsakis:nll-master-to-rust-master-2, r=pnkfelixbors-6/+6
NLL: improve inference with flow results, represent regions with bitsets, and more This PR begins with a number of edits to the NLL code and then includes a large number of smaller refactorings (these refactorings ought not to change behavior). There are a lot of commits here, but each is individually simple. The goal is to land everything up to but not including the changes to how we handle closures, which are conceptually more complex. The NLL specific changes are as follows (in order of appearance): **Modify the region inferencer's approach to free regions.** Previously, for each free region (lifetime parameter) `'a`, it would compute the set of other free regions that `'a` outlives (e.g., if we have `where 'a: 'b`, then this set would be `{'a, 'b}`). Then it would mark those free regions as "constants" and report an error if inference tried to extend `'a` to include any other region (e.g., `'c`) that is not in that outlives set. In this way, the value of `'a` would never grow beyond the maximum that could type check. The new approach is to allow `'a` to grow larger. Then, after the fact, we check over the value of `'a` and see what other free regions it is required to outlive, and we check that those outlives relationships are justified by the where clauses in scope etc. **Modify constraint generation to consider maybe-init.** When we have a "drop-live" variable `x` (i.e., a variable that will be dropped but will not be otherwise used), we now consider whether `x` is "maybe initialized" at that point. If not, then we know the drop is a no-op, and we can allow its regions to be dead. Due to limitations in the fragment code, this currently only works at the level of entire variables. **Change representation of regions to use a `BitMatrix`.** We used to use a `BTreeSet`, which was rather silly. We now use a MxN matrix of bits, where `M` is the number of variables and `N` is the number of possible elements in each set (size of the CFG + number of free regions). The remaining commits (starting from extract the `implied_bounds` code into a helper function ") are all "no-op" refactorings, I believe. ~~One concern I have is with the commit "with -Zverbose, print all details of closure substs"; this commit seems to include some "internal" stuff in the mir-dump files, such as internal interner numbers, that I fear may vary by platform. Annoying. I guess we will see.~~ (I removed this commit.) As for reviewer, @arielb1 has been reviewing the PRs, and they are certainly welcome to review this one too. But I figured it'd maybe be good to have more people taking a look and being familiar with this code, so I'll "nominate" @pnkfelix . r? @pnkfelix
2017-12-04constraint_generation: create liveness constraints more thoroughlyNiko Matsakis-4/+4
We now visit just the stuff in the CFG, and we add liveness constraints for all the random types, regions etc that appear within rvalues and statements.
2017-12-04replace constant regions with a post-inference checkNiko Matsakis-2/+2
Rather than declaring some region variables to be constant, and reporting errors when they would have to change, we instead populate each free region X with a minimal set of points (the CFG plus end(X)), and then we let inference do its thing. This may add other `end(Y)` points into X; we can then check after the fact that indeed `X: Y` holds. This requires a bit of "blame" detection to find where the bad constraint came from: we are currently using a pretty dumb algorithm. Good place for later expansion.
2017-12-03Add an i128_lowering flag in TargetOptionsScott McMurray-2/+2
Not actually enabled by default anywhere yet.
2017-12-03Rollup merge of #46462 - sinkuu:copyprop_reg2, r=arielb1Corey Farwell-26/+50
Fix CopyPropagation regression (2) Remaining part of MIR copyprop regression by (I think) #45380, which I missed in #45753. ```rust fn foo(mut x: i32) -> i32 { let y = x; x = 123; // `x` is assigned only once in MIR, but cannot be propagated to `y` y } ``` So any assignment to an argument cannot be propagated.
2017-12-03Auto merge of #46320 - arielb1:always-resume, r=nikomatsakisbors-206/+230
Always unwind through a Resume and other fixes Should fix most of the small MIR borrowck issues. r? @nikomatsakis
2017-12-03fix tests in wasmAriel Ben-Yehuda-6/+8
2017-12-03Fix MIR CopyPropagation regressionShotaro Yamada-26/+50
2017-12-02Add ignore-emscripten tooScott McMurray-0/+2
2017-12-02Ignore the lower_128bit tests on asmjsScott McMurray-0/+8
2017-12-02Remove the unneeded #![feature(lang_items)]sScott McMurray-2/+0
2017-12-02Update compiler-builtins and use it the 128-bit lowering MIR testScott McMurray-91/+32
2017-12-03add and unignore testsAriel Ben-Yehuda-2/+1
2017-12-03funnel all unwind paths through a single Resume blockAriel Ben-Yehuda-198/+220
This simplifies analysis and borrow-checking because liveness at the resume point can always be simply propagated. Later on, the "dead" Resumes are removed.
2017-12-03initialize the destination in unit statementsAriel Ben-Yehuda-0/+1
Fixes #46159.
2017-11-28ci: Start running wasm32 tests on TravisAlex Crichton-0/+6
This commit allocates a builder to running wasm32 tests on Travis. Not all test suites pass right now so this is starting out with just the run-pass and the libcore test suites. This'll hopefully give us a pretty broad set of coverage for integration in rustc itself as well as a somewhat broad coverage of the llvm backend itself through integration/unit tests.