Fix issue #269, optimize signed compare with 0
authorC-Elegans <mtnolan2640@gmail.com>
Sun, 15 Jan 2017 14:23:04 +0000 (09:23 -0500)
committerC-Elegans <mtnolan2640@gmail.com>
Sun, 15 Jan 2017 18:38:29 +0000 (13:38 -0500)
commit943389cdd50e8c77d76f64ba9abffa5190e5106a
treefb6c956d3ec9bb5f63f4bc04511c8358678fd30e
parentb7cfb7dbd250a8595589f86e1b38b67015c7b9c5
Fix issue #269, optimize signed compare with 0

add opt_compare pass and add it to opt
for a < 0:
    if a is signed, replace with a[max_bit-1]
for a >= 0:
    if a is signed, replace with ~a[max_bit-1]
passes/opt/Makefile.inc
passes/opt/opt.cc
passes/opt/opt_compare.cc [new file with mode: 0644]