fix killing OP_COMPUTEDGOTO
commitd3bf74f5f13702fc758d442894ad034e55328062
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Sun, 29 Jan 2017 10:48:06 +0000 (29 11:48 +0100)
committerChristopher Li <sparse@chrisli.org>
Mon, 13 Feb 2017 01:34:45 +0000 (13 09:34 +0800)
tree0bc2a489c72f440336ffc53d9693d1c50518fb4f
parent61c406241c5d1a8da3f829e51e18f20b77f25926
fix killing OP_COMPUTEDGOTO

Currently kill_instruction() doesn't do anything with the
operands of computed gotos (OP_COMPUTEDGOTO). But when these
instructions are removed we must also remove the operands 'usage'.
Without this some instructions, which provides the select's
operands, are not optimized away as expected.

The fix consists by killing it's operand much like what is done for
conditional branches.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
simplify.c
validation/kill-computedgoto.c [new file with mode: 0644]