Optimize compares to powers of 2
authorC-Elegans <mtnolan2640@gmail.com>
Mon, 16 Jan 2017 15:16:03 +0000 (10:16 -0500)
committerC-Elegans <mtnolan2640@gmail.com>
Mon, 16 Jan 2017 18:45:50 +0000 (13:45 -0500)
commit84f9cd0025b080c7b1fc2dc86aaacc08a8f88805
treeece1f333fbb3ac6a3ac8688ba32fcd17a65f900f
parent943389cdd50e8c77d76f64ba9abffa5190e5106a
Optimize compares to powers of 2
Remove opt_compare and put comparison pass in opt_expr

assuming a [7:0] is unsigned
a >= (1<<x) becomes |a[7:x]
a <  (1<<x) becomes !a[7:x]

Additionally:
a >= 0 becomes constant true,
a < 0 becomes constant false

delete opt_compare.cc
revert opt.cc to commit b7cfb7dbd (remove opt_compare step)
passes/opt/Makefile.inc
passes/opt/opt.cc
passes/opt/opt_compare.cc [deleted file]
passes/opt/opt_expr.cc