Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
Description
The first instruction of every block is kept as the label for that block.
This means that even if it is useless it will not be removed.
if (a === 0) {
1 + 1
}
The content of the if branch gets generate to be this
9: 14 00 08 MoveConst C0, r2 12: 10 01 LoadInt 1 14: 80 08 Add r2, acc
And then optimized to
9: 14 00 08 MoveConst C0, r2
where the first instruction is kept because it "holds" the label.
This could potentially also prevent detecting empty branches later on.