I added guard instructions to the set of instructions that can be subject to common subexpression elimination. They are not strictly expressions since they don’t calculate a value, but they can be eliminated just like common subexpressions. To calculate the value number of a guard we compute the sum of the operand’s value numbers and add the hash code of the GUARD class. We intentially do not include the branch type in the value number, because we want complementary branches to match (LT and GE are equivalent if the operands are swapped around).

### Like this:

Like Loading...

*Related*