Avoid loop_match self-assignment in MIR lowering#155186
Avoid loop_match self-assignment in MIR lowering#155186cijiugechu wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
rustbot has assigned @jdonszelmann. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Just conceptually, would it not be better to remove the assignment completely? Or does that not work? I've previously tried to change the code so that the assignment does not get introduced, but that did not work out (it would, from memory, require overhauling a whole bunch of code). |
I did consider this approach at first, but I was worried that it might have a fairly significant impact on MIR semantics. Once |
|
Additionally, I also considered the performance impact. I compared the LLVM IR generated by the compiler for |
Transform
to
Closes #143806
Previous MIR
Current MIR