summary refs log tree commit diff
path: root/src/test/mir-opt
AgeCommit message (Collapse)AuthorLines
2020-11-06Disable MatchBranchSimplificationTomasz Miąsko-150/+172
This optimization can result in unsoundness, because it introduces additional uses of a place holding the discriminant value without ensuring that it is valid to do so.
2020-11-06Disable "optimization to avoid load of address" in InstCombineTomasz Miąsko-3/+3
2020-10-02Ignore now-broken mir-opt testJonas Schievink-1/+4
2020-10-01Disable the SimplifyArmIdentity mir-optWesley Wiser-150/+153
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-10-01Bless mir-opt tests for 32 bitAntoine Martin-16/+12
2020-10-01Add test for multiple terminator optimizationAntoine Martin-0/+44
2020-10-01Bless mir-opt tests with new optAntoine Martin-106/+52
2020-09-30Auto merge of #77069 - sexxi-goose:closure_print_2, r=nikomatsakisbors-2/+2
pretty.rs: Update Closure and Generator print More detailed outline: https://github.com/rust-lang/project-rfc-2229/pull/17 Closes: https://github.com/rust-lang/project-rfc-2229/issues/11 r? `@nikomatsakis` cc `@eddyb` `@davidtwco` `@estebank`
2020-09-29Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morsebors-56/+56
Clean up diagnostics for arithmetic operation errors Plus a small tweak to a range pattern error message.
2020-09-28pretty.rs: Update Closure and Generator printAman Arora-2/+2
Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com> Co-authored-by: Logan Mosier <logmosier@gmail.com>
2020-09-27Remove unnecessary -Zunsound-mir-opts uses in testsWesley Wiser-168/+177
2020-09-27[mir-opt] Introduce a new flag to enable experimental/unsound mir optsWesley Wiser-357/+391
2020-09-26Bless mir-opt 32-bit testsvarkor-21/+21
2020-09-26Bless mir-opt testsvarkor-35/+35
2020-09-25Fix testsmarmeladema-8/+8
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-74/+74
2020-09-25Rollup merge of #77066 - jonas-schievink:dest-prop-borrow, r=oli-obkJonas Schievink-178/+188
Fix dest prop miscompilation around references Closes https://github.com/rust-lang/rust/issues/77002
2020-09-25Auto merge of #76844 - simonvandel:fix-76803, r=wesleywiserbors-12/+62
Fix #76803 miscompilation Fixes #76803 Seems like it was an oversight that the discriminant value being set was not compared to the target value from the SwitchInt, as a comment says this is a requirement for the optimization to be sound. r? `@wesleywiser` since you are probably familiar with the optimization and made #76837 to workaround the bug
2020-09-23Auto merge of #76673 - simonvandel:remove-unneeded-drops, r=oli-obkbors-8/+149
MIR pass to remove unneeded drops on types not needing drop This is heavily dependent on MIR inlining running to actually see the drop statement. Do we want to special case replacing a call to std::mem::drop with a goto aswell?
2020-09-23Ignore test on wasm as it does not unwindSimon Vandel Sillesen-46/+47
2020-09-23Auto merge of #76659 - simonvandel:76432, r=oli-obkbors-0/+132
SimplifyComparisonIntegral: fix miscompilation Fixes #76432 Only insert StorageDeads if we actually removed one. Fixes an issue where we added StorageDead to a place with no StorageLive r? `@oli-obk`
2020-09-22rebless after rebaseSimon Vandel Sillesen-8/+0
2020-09-22cleanup cfg after optimizationSimon Vandel Sillesen-8/+6
2020-09-22MIR pass to remove unneeded drops on types not needing dropSimon Vandel Sillesen-0/+150
This is heavily dependent on MIR inlining running to actually see the drop statement
2020-09-22Bless mir-opt testsJonas Schievink-178/+188
2020-09-21Run the test with explicit -O such that Add is generated instead of CheckedAddSimon Vandel Sillesen-197/+198
This makes the test run deterministic regardless of noopt testruns
2020-09-21Add optimization to avoid load of addressSimon Vandel Sillesen-10/+390
2020-09-20emit diff after SimplifyBranches-after-copy-propSimon Vandel Sillesen-168/+480
2020-09-20add cleanup of cfgSimon Vandel Sillesen-104/+103
2020-09-20insert storageDead for not equal tempSimon Vandel Sillesen-0/+10
2020-09-20correct commentSimon Vandel Sillesen-992/+0
2020-09-20blessSimon Vandel Sillesen-349/+265
2020-09-20replace usize with u32 to make it easier to blessSimon Vandel Sillesen-18/+15
2020-09-20New MIR optimization pass to reduce branches on match of tuples of enumsSimon Vandel Sillesen-0/+1804
2020-09-20Auto merge of #75346 - ↵bors-2/+2
davidtwco:issue-69925-polymorphic-instancedef-fnptrshim, r=nikomatsakis shim: monomorphic `FnPtrShim`s during construction Fixes #69925. This PR adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`). r? `@eddyb`
2020-09-20Auto merge of #72632 - jonas-schievink:dest-prop, r=oli-obkbors-455/+828
Implement a generic Destination Propagation optimization on MIR This takes the work that was originally started by `@eddyb` in https://github.com/rust-lang/rust/pull/47954, and then explored by me in https://github.com/rust-lang/rust/pull/71003, and implements it in a general (ie. not limited to acyclic CFGs) and dataflow-driven way (so that no additional infrastructure in rustc is needed). The pass is configured to run at `mir-opt-level=2` and higher only. To enable it by default, some followup work on it is still needed: * Performance needs to be evaluated. I did some light optimization work and tested against `tuple-stress`, which caused trouble in my last attempt, but didn't go much in depth here. * We can also enable the pass only at `opt-level=2` and higher, if it is too slow to run in debug mode, but fine when optimizations run anyways. * Debuginfo needs to be fixed after locals are merged. I did not look into what is required for this. * Live ranges of locals (aka `StorageLive` and `StorageDead`) are currently deleted. We either need to decide that this is fine, or if not, merge the variable's live ranges (or remove these statements entirely – https://github.com/rust-lang/rust/issues/68622). Some benchmarks of the pass were done in https://github.com/rust-lang/rust/pull/72635.
2020-09-19Fix #76803Simon Vandel Sillesen-21/+22
Check that the variant index matches the target value from the SwitchInt we came from
2020-09-19Add regression test showcasing miscompilationSimon Vandel Sillesen-0/+49
2020-09-19Rollup merge of #75580 - JulianKnodt:or_pattern, r=wesleywiserRalf Jung-0/+108
Add test for checking duplicated branch or-patterns This adds a regression test for checking `or-patterns` in MIR as shown in #75439. This doesn't introduce a fix as I'm not sure where it would go(I suspect maybe here: src/librustc_mir_build/build/matches/mod.rs), and I'm not particularly able to fix it. cc: @lzutao
2020-09-18Fix dest-prop mir-opt testsJonas Schievink-81/+25
2020-09-18Add a few dest-prop MIR testsJonas Schievink-0/+362
2020-09-18Bless mir-opt testsJonas Schievink-342/+259
2020-09-18Make nrvo-simple set mir-opt-level=1Jonas Schievink-26/+31
The additional copies are due to the lack of copy propagation
2020-09-18simplify_try: clean up testJonas Schievink-158/+157
2020-09-18simplify_try: print dest_prop diff and blessJonas Schievink-2/+148
The new diff is to convince me that this is correct and nothing funky is going on.
2020-09-18Auto merge of #76837 - wesleywiser:disable_consideredequal, r=oli-obkbors-15/+12
[mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame opt The logic is currently broken and we need to disable it to fix a beta regression (see #76803) r? `@oli-obk`
2020-09-17Rename 32 bit mir files to be more tool friendlyNixon Enraght-Moony-0/+0
See #75746
2020-09-17Rename 64 bit mir files to be more tool friendlyNixon Enraght-Moony-0/+210
See #75746
2020-09-17[mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame optWesley Wiser-15/+12
The logic is currently broken and we need to disable it to fix a beta regression (see #76803)
2020-09-14Auto merge of #76123 - tmiasko:inline-args-storage, r=wesleywiserbors-0/+14
inliner: Emit storage markers for introduced arg temporaries When introducing argument temporaries during inlining, emit storage marker statements just before the assignment and in the beginning of the return block. This ensures that such temporaries will not be considered live across yield points after inlining inside a generator. Fixes #71793.