about summary refs log tree commit diff
path: root/src/test/mir-opt/simplify-arm.rs
AgeCommit message (Collapse)AuthorLines
2022-11-02Ban dashes in miropt test file namesJakob Degen-50/+0
2022-09-01Simplify MIR opt testsJakob Degen-0/+3
This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized. Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the result of the net result of the optimization pipeline's output is.
2021-05-18No matter how trivial the change, tidy always finds a way to complain...Scott McMurray-2/+2
2021-05-18Mention the issue number for the new mir-opt in the FIXMEs scottmcm-1/+1
Thanks for the suggestions, lcnr! Co-authored-by: lcnr <rust@lcnr.de>
2021-05-09PR feedbackScott McMurray-4/+4
2021-05-06mir-opt & codegen test updatesScott McMurray-1/+16
`SimplifyArm` and such are currently in `-Zunsound-mir-opts` and thus weren't running by default, so having something like them for the new desugar shouldn't be necessary for switching.
2021-03-05Bump mir-opt-level from 2 to 3 in testsSantiago Pastorino-1/+1
2020-10-01Disable the SimplifyArmIdentity mir-optWesley Wiser-1/+1
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-08-16Implement 'considered equal' for statements, so that for example `_0 = _1` ↵Simon Vandel Sillesen-1/+1
and `discriminant(_0) = discriminant(0)` are considered equal if 0 is a fieldless variant of an enum
2020-07-29add crate name to mir dumpsXavier Denis-6/+6
2020-05-11Modify SimplifyArmIdentity so it can trigger on mir-opt-level=1Wesley Wiser-0/+32
I also added test cases to make sure the optimization can fire on all of these cases: ```rust fn case_1(o: Option<u8>) -> Option<u8> { match o { Some(u) => Some(u), None => None, } } fn case2(r: Result<u8, i32>) -> Result<u8, i32> { match r { Ok(u) => Ok(u), Err(i) => Err(i), } } fn case3(r: Result<u8, i32>) -> Result<u8, i32> { let u = r?; Ok(u) } ``` Without MIR inlining, this still does not completely optimize away the `?` operator because the `Try::into_result()`, `From::from()` and `Try::from_error()` calls still exist. This does move us a bit closer to that goal though because: - We can now run the pass on mir-opt-level=1 - We no longer depend on the copy propagation pass running which is unlikely to stabilize anytime soon.