projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed unused variables.
[libfirm]
/
ir
/
be
/
beinfo.c
diff --git
a/ir/be/beinfo.c
b/ir/be/beinfo.c
index
dc4a52d
..
c1a04fa
100644
(file)
--- a/
ir/be/beinfo.c
+++ b/
ir/be/beinfo.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-20
08
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-20
11
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-35,7
+35,7
@@
#include "irdump_t.h"
#include "error.h"
#include "irdump_t.h"
#include "error.h"
-static copy_attr_func
old_phi_copy_attr;
+static copy_attr_func old_phi_copy_attr;
void be_info_new_node(ir_node *node)
{
void be_info_new_node(ir_node *node)
{
@@
-43,7
+43,7
@@
void be_info_new_node(ir_node *node)
backend_info_t *info;
/* Projs need no be info, their tuple holds all information */
backend_info_t *info;
/* Projs need no be info, their tuple holds all information */
- if (is_Proj(node))
+ if (is_Proj(node))
return;
obst = be_get_be_obst(current_ir_graph);
return;
obst = be_get_be_obst(current_ir_graph);
@@
-52,19
+52,38
@@
void be_info_new_node(ir_node *node)
assert(node->backend_info == NULL);
node->backend_info = info;
assert(node->backend_info == NULL);
node->backend_info = info;
- /*
Hack! We still have middle end nodes in the backend (which was probably
- a bad decision back then), which have no register constraints.
- Set some none_requirements here.
+ /*
+ * Set backend info for some middleend nodes which still appear in
+ * backend graphs
*/
*/
- if (get_irn_mode(node) != mode_T
- && get_irn_opcode(node) <= iro_Last) {
+ switch (get_irn_opcode(node)) {
+ case iro_Bad:
+ case iro_Block:
+ case iro_Dummy:
+ case iro_End:
+ case iro_NoMem:
+ case iro_Unknown:
+ info->flags |= arch_irn_flags_not_scheduled;
+ break;
+ case iro_Anchor:
+ case iro_Pin:
+ case iro_Sync:
+ info->flags |= arch_irn_flags_not_scheduled;
info->out_infos = NEW_ARR_D(reg_out_info_t, obst, 1);
memset(info->out_infos, 0, 1 * sizeof(info->out_infos[0]));
info->out_infos[0].req = arch_no_register_req;
info->out_infos = NEW_ARR_D(reg_out_info_t, obst, 1);
memset(info->out_infos, 0, 1 * sizeof(info->out_infos[0]));
info->out_infos[0].req = arch_no_register_req;
+ break;
+ case iro_Phi:
+ info->out_infos = NEW_ARR_D(reg_out_info_t, obst, 1);
+ memset(info->out_infos, 0, 1 * sizeof(info->out_infos[0]));
+ info->out_infos[0].req = arch_no_register_req;
+ break;
+ default:
+ break;
}
}
}
}
-static void new_
P
hi_copy_attr(ir_graph *irg, const ir_node *old_node,
+static void new_
p
hi_copy_attr(ir_graph *irg, const ir_node *old_node,
ir_node *new_node)
{
backend_info_t *old_info = be_get_info(old_node);
ir_node *new_node)
{
backend_info_t *old_info = be_get_info(old_node);
@@
-75,14
+94,25
@@
static void new_Phi_copy_attr(ir_graph *irg, const ir_node *old_node,
old_phi_copy_attr(irg, old_node, new_node);
}
old_phi_copy_attr(irg, old_node, new_node);
}
-int be_
infos_equal(const backend_info_t *info1, const backend_info_t *info
2)
+int be_
nodes_equal(const ir_node *node1, const ir_node *node
2)
{
{
- 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);
+ size_t len = ARR_LEN(info1->out_infos);
+ int arity = get_irn_arity(node1);
+ int in;
+ size_t i;
if (ARR_LEN(info2->out_infos) != len)
return false;
if (ARR_LEN(info2->out_infos) != len)
return false;
+ assert(arity == get_irn_arity(node2));
+
+ for (in = 0; in < arity; ++in) {
+ if (info1->in_reqs[in] != info2->in_reqs[in])
+ 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];
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
+125,6
@@
int be_infos_equal(const backend_info_t *info1, const backend_info_t *info2)
return true;
}
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;
static void init_walker(ir_node *node, void *data)
{
(void) data;
@@
-116,7
+139,7
@@
void be_info_init(void)
panic("double initialization of be_info");
old_phi_copy_attr = op_Phi->ops.copy_attr;
panic("double initialization of be_info");
old_phi_copy_attr = op_Phi->ops.copy_attr;
- op_Phi->ops.copy_attr = new_
P
hi_copy_attr;
+ op_Phi->ops.copy_attr = new_
p
hi_copy_attr;
initialized = true;
/* phis have register and register requirements now which we want to dump */
initialized = true;
/* phis have register and register requirements now which we want to dump */
@@
-156,7
+179,7
@@
void be_info_free(void)
if (!initialized)
panic("be_info_free called without prior init");
if (!initialized)
panic("be_info_free called without prior init");
- assert(op_Phi->ops.copy_attr == new_
P
hi_copy_attr);
+ assert(op_Phi->ops.copy_attr == new_
p
hi_copy_attr);
op_Phi->ops.copy_attr = old_phi_copy_attr;
initialized = false;
op_Phi->ops.copy_attr = old_phi_copy_attr;
initialized = false;