X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeinfo.c;h=10ba2e18d4bb3c88192065f61f684f648c2c878e;hb=36e688467f3e9fed2b96e2d7f323edffa4268b53;hp=51f4327b1fd5564c866b0789810a5493c464a94c;hpb=0a4048fbaae21a969b0f03b066dde30a06968814;p=libfirm diff --git a/ir/be/beinfo.c b/ir/be/beinfo.c index 51f4327b1..10ba2e18d 100644 --- a/ir/be/beinfo.c +++ b/ir/be/beinfo.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -35,14 +35,14 @@ #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) { struct obstack *obst; backend_info_t *info; - /* Projs need no be info, their tuple holds all information */ + /* Projs need no be info, all info is fetched from their predecessor */ if (is_Proj(node)) return; @@ -52,15 +52,32 @@ void be_info_new_node(ir_node *node) 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_Block: + case iro_Dummy: + case iro_NoMem: + case iro_Anchor: + case iro_Pin: + case iro_Sync: + case iro_Bad: + case iro_End: + case iro_Unknown: + 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; + 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; } } @@ -75,7 +92,7 @@ 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_nodes_equal(ir_node *node1, ir_node *node2) +int be_nodes_equal(const ir_node *node1, const ir_node *node2) { const backend_info_t *info1 = be_get_info(node1); const backend_info_t *info2 = be_get_info(node2);