summaryrefslogtreecommitdiff
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-03-29 11:19:21 +0100
committerClifford Wolf <clifford@clifford.at>2013-03-29 11:19:21 +0100
commit88af5b6a162ebc4fcc753794b38491e7897b702a (patch)
treedbf51c9f01b4bb7fe5224d0f558d6bc4ce09c867 /passes
parent0d48b846ac8ed74b607fc4706e742a45ab86f2dd (diff)
Improved opt_share for reduce cells
Diffstat (limited to 'passes')
-rw-r--r--passes/opt/opt_share.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/passes/opt/opt_share.cc b/passes/opt/opt_share.cc
index 6dd4daa0..43d1a57e 100644
--- a/passes/opt/opt_share.cc
+++ b/passes/opt/opt_share.cc
@@ -76,6 +76,18 @@ struct OptShareWorker
alt_conn["\\B"] = conn->at("\\A");
}
conn = &alt_conn;
+ } else
+ if (cell->type == "$reduce_xor" || cell->type == "$reduce_xnor") {
+ alt_conn = *conn;
+ assign_map.apply(alt_conn.at("\\A"));
+ alt_conn.at("\\A").sort();
+ conn = &alt_conn;
+ } else
+ if (cell->type == "$reduce_and" || cell->type == "$reduce_or" || cell->type == "$reduce_bool") {
+ alt_conn = *conn;
+ assign_map.apply(alt_conn.at("\\A"));
+ alt_conn.at("\\A").sort_and_unify();
+ conn = &alt_conn;
}
for (auto &it : *conn) {
@@ -151,6 +163,14 @@ struct OptShareWorker
conn2["\\A"] = conn2["\\B"];
conn2["\\B"] = tmp;
}
+ } else
+ if (cell1->type == "$reduce_xor" || cell1->type == "$reduce_xnor") {
+ conn1["\\A"].sort();
+ conn2["\\A"].sort();
+ } else
+ if (cell1->type == "$reduce_and" || cell1->type == "$reduce_or" || cell1->type == "$reduce_bool") {
+ conn1["\\A"].sort_and_unify();
+ conn2["\\A"].sort_and_unify();
}
if (conn1 != conn2) {