about summary refs log tree commit diff
path: root/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff
AgeCommit message (Collapse)AuthorLines
2022-09-04Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTHJakob Degen-113/+0
2022-09-01Simplify MIR opt testsJakob Degen-15/+86
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.
2022-07-28bless mir opt testsNilstrieb-22/+22
2022-04-06enhance `ConstGoto` mir-opt by moving up `StorageDead` statementsSparrowLii-59/+15
2021-09-05Change scope of temporaries in match guardsMatthew Jasper-1/+1
Each pattern in a match arm has its own copy of the match guard in MIR, with its own temporary, so it has to be dropped before the the guards are joined to the single copy of the arm.
2021-09-01Fix drop handling for `if let` expressionsMatthew Jasper-62/+37
MIR lowering for `if let` expressions is now more complicated now that `if let` exists in HIR. This PR adds a scope for the variables bound in an `if let` expression and then uses an approach similar to how we handle loops to ensure that we reliably drop the correct variables.
2021-08-25Fix debugger stepping behavior around `match` expressionsWesley Wiser-2/+2
Previously, we would set up the source lines for `match` expressions so that the code generated to perform the test of the scrutinee was matched to the line of the arm that required the test and then jump from the arm block to the "next" block was matched to all of the lines in the `match` expression. While that makes sense, it has the side effect of causing strange stepping behavior in debuggers. I've changed the source information so that all of the generated tests are sourced to `match {scrutinee}` and the jumps are sourced to the last line of the block they are inside. This resolves the weird stepping behavior in all debuggers and resolves some instances of "ambiguous symbol" errors in WinDbg preventing the user from setting breakpoints at `match` expressions.
2021-02-22New mir-opt pass to simplify gotos with const valuesSimon Vandel Sillesen-64/+64
Fixes #77355
2021-02-21Make MatchBranchSimplification clean up after itselfSimon Vandel Sillesen-59/+54
2021-01-07Reintroduce hir::ExprKind::IfCaio-10/+10
2020-10-21Introduce a temporary for discriminant value in MatchBranchSimplificationTomasz Miąsko-0/+116
The optimization introduces additional uses of the discriminant operand, but does not ensure that it is still valid to evaluate it or that it still evaluates to the same value. Evaluate it once at original position, and store the result in a new temporary.