summaryrefslogtreecommitdiff
path: root/sched
diff options
context:
space:
mode:
Diffstat (limited to 'sched')
-rw-r--r--sched/simplify.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/sched/simplify.ml b/sched/simplify.ml
index 37e4539..c0cd07e 100644
--- a/sched/simplify.ml
+++ b/sched/simplify.ml
@@ -136,6 +136,14 @@ let arith_simplify p =
| Ebinop(Xor, Aconst([|false|]), x) -> Earg(x)
| Ebinop(Xor, x, Aconst([|false|])) -> Earg(x)
+ | Ebinop(Nand, Avar(a), Avar(b)) when a = b ->
+ Enot(Avar(a))
+ | Ebinop(Xor, Avar(a), Avar(b)) when a = b ->
+ let sz = Env.find a p.p_vars in
+ Earg(Aconst(Array.make sz false))
+ | Ebinop(_, Avar(a), Avar(b)) when a = b ->
+ Earg(Avar(a))
+
| Eslice(i, j, k) when i = j -> Eselect(i, k)
| Econcat(Aconst(a), Aconst(b)) ->