add killing of pure calls
commitaa07c1187a8971e40a710826a5efecb79812bc8b
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Thu, 16 Feb 2017 04:57:01 +0000 (16 05:57 +0100)
committerChristopher Li <sparse@chrisli.org>
Thu, 16 Feb 2017 12:43:07 +0000 (16 20:43 +0800)
treee086564e2bab075753691f4c09b2dfbf23220469
parentb25e49741013d3b6af9e57fd4e4edb0f0f62ba51
add killing of pure calls

OP_CALL were ignored by kill_instruction() but there are two cases
were something can or must be done:
1) if the function is pure, it is free of side-effects and can thus
   be optimized away like others instructions.
2) if force-killed then we need to adjust the usage of all the arguments.

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