Open
Description
#78191 fixes a bug in MatchBranchSimplification but causes it to create some "boilerplate". We should try to optimize it away again. One example is
- switchInt(_4) -> [false: bb7, otherwise: bb8];
+ StorageLive(_9);
+ _9 = _4;
+ _3 = Ne(_9, const false);
+ StorageDead(_9);
+ goto -> bb9;
for which we should make sure that copy prop still manages to remove _9
.
Other situations are
- switchInt(move _3) -> [false: bb11, otherwise: bb10];
+ StorageLive(_10);
+ _10 = move _3;
+ StorageDead(_3);
+ _1 = Ne(_10, const false);
+ StorageDead(_10);
+ goto -> bb12;
which are more complex. But since it is always safe (haha, uh, I think) to move a StorageDead
further down and a StorageLive
further up, we should be able to move the StorageDead(_3)
after _1 = Ne(_10, const false);
, thus allowing copy prop to handle this again.