opt_expr: simplify any unsigned comparisons with all-0 and all-1.
authorwhitequark <whitequark@whitequark.org>
Wed, 2 Jan 2019 02:45:49 +0000 (02:45 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 2 Jan 2019 02:45:49 +0000 (02:45 +0000)
commit8e53d2e0bf3584709cd320447ad5a89a80dcfd94
treec049d8ae6018c9efe0dec86da5bf180ae75a1bf9
parent4b9f619349e6b7452739631635ab3b5a4d94b522
opt_expr: simplify any unsigned comparisons with all-0 and all-1.

Before this commit, only unsigned comparisons with all-0 would be
simplified. This commit also makes the code handling such comparisons
to be more rigorous and not abort on unexpected input.
passes/opt/opt_expr.cc
tests/opt/opt_expr_cmp.v [new file with mode: 0644]
tests/opt/opt_expr_cmp.ys [new file with mode: 0644]