Simplification for associative and commutative operations on constants

The purpose of this change is to enable the instruction simplifier
to recognize patterns such as

OP y, x, const1
OP z, y, const2

where OP is both an associative and a commutative operation on integral
types, and replace them with

OP z, x, const3

Since subtraction on integral types is equivalent to addition with a
negated operand, it receives a similar treatment, even though it is
not commutative.

Change-Id: I278cac39bd39bc843d250a976931cb000876ea88
3 files changed