summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beinfo.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2010-09-10 15:26:25 +0200
committerMatthias Braun <matze@braunis.de>2010-09-10 15:26:25 +0200
commit07ce9818702faae854ee98b17e94a30a7a7022b5 (patch)
tree916cc61f266b730b9befb6429bdb38be1429de60 /ir/be/beinfo.c
parent9f0181406f5285439f6a94d61d404e82febc13b3 (diff)
save input requirements in be_info without complicated callback
[r27995]
Diffstat (limited to 'ir/be/beinfo.c')
-rw-r--r--ir/be/beinfo.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ir/be/beinfo.c b/ir/be/beinfo.c
index 837d223..f4a88c7 100644
--- a/ir/be/beinfo.c
+++ b/ir/be/beinfo.c
@@ -75,14 +75,24 @@ static void new_Phi_copy_attr(ir_graph *irg, const ir_node *old_node,
old_phi_copy_attr(irg, old_node, new_node);
}
-int be_infos_equal(const backend_info_t *info1, const backend_info_t *info2)
+int be_nodes_equal(ir_node *node1, ir_node *node2)
{
- int len = ARR_LEN(info1->out_infos);
- int i;
+ const backend_info_t *info1 = be_get_info(node1);
+ const backend_info_t *info2 = be_get_info(node2);
+ int len = ARR_LEN(info1->out_infos);
+ int arity = get_irn_arity(node1);
+ int i;
if (ARR_LEN(info2->out_infos) != len)
return false;
+ assert(arity == get_irn_arity(node2));
+
+ for (i = 0; i < arity; ++i) {
+ if (info1->in_reqs[i] != info2->in_reqs[i])
+ return false;
+ }
+
for (i = 0; i < len; ++i) {
const reg_out_info_t *out1 = &info1->out_infos[i];
const reg_out_info_t *out2 = &info2->out_infos[i];
@@ -95,13 +105,6 @@ int be_infos_equal(const backend_info_t *info1, const backend_info_t *info2)
return true;
}
-int be_nodes_equal(const ir_node *node1, const ir_node *node2)
-{
- backend_info_t *info1 = be_get_info(node1);
- backend_info_t *info2 = be_get_info(node2);
- return be_infos_equal(info1, info2);
-}
-
static void init_walker(ir_node *node, void *data)
{
(void) data;