aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-02-14 22:56:38 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-02-20 11:29:24 +0100
commitf46c93967ce3d6f2644059e07db9755e202893bc (patch)
treee89efe3544233799484f2d4dec0ed07610e0eb21
parentd7529936fa7dfdff32885b3a96473883e6b70fa3 (diff)
downloadsparse-dev-f46c93967ce3d6f2644059e07db9755e202893bc.tar.gz
unsigned multiplication is also associative
Currently, only signed multiplication is considered as associative but in truth both signed & unsigned are. So, make unsigned multiplication associative too. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--simplify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/simplify.c b/simplify.c
index dbea438e..a20cc7e7 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1168,6 +1168,7 @@ int simplify_instruction(struct instruction *insn)
return 0;
switch (insn->opcode) {
case OP_ADD: case OP_MULS:
+ case OP_MULU:
case OP_AND: case OP_OR: case OP_XOR:
case OP_AND_BOOL: case OP_OR_BOOL:
canonicalize_commutative(insn);
@@ -1175,7 +1176,6 @@ int simplify_instruction(struct instruction *insn)
return REPEAT_CSE;
return simplify_associative_binop(insn);
- case OP_MULU:
case OP_SET_EQ: case OP_SET_NE:
canonicalize_commutative(insn);
return simplify_binop(insn);