+/**
+ * This file contains the following IRG modifications for be routines:
+ * - backend dominance information
+ * - SSA construction for a set of nodes
+ * - insertion of Perm nodes
+ * - empty block elimination
+ * - a simple dead node elimination (set inputs of unreachable nodes to BAD)
+ *
+ * Author: Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
+ * Date: 04.05.2005
+ * Copyright: (c) Universitaet Karlsruhe
+ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * CVS-Id: $Id$
+ */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <stdlib.h>
#include "beirgmod.h"
-#define DBG_MODULE "firm.be.irgmod"
#define DBG_LEVEL SET_LEVEL_0
+DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
/*
____ _
{
ir_node *bl;
waitq *worklist = new_waitq();
- FIRM_DBG_REGISTER(firm_dbg_module_t *dbg, DBG_MODULE);
/*
* Fill the worklist queue and the rest of the orig blocks array.
{
ir_node *curr_bl;
ir_node *start_irn;
- FIRM_DBG_REGISTER(firm_dbg_module_t *dbg, DBG_MODULE);
curr_bl = get_nodes_block(usage);
int pos;
} *outs;
- FIRM_DBG_REGISTER(firm_dbg_module_t *dbg, DBG_MODULE);
-
obstack_init(&obst);
/*
for (irn = pset_first(copies); irn; irn = pset_next(copies)) {
const ir_edge_t *edge;
foreach_out_edge(irn, edge) {
- if (!pset_find_ptr(ignore_uses, get_edge_src_irn(edge))) {
+ ir_node *src = get_edge_src_irn(edge);
+ /* ignore all users from ignore_uses or keep-alives (user is End node) */
+ if (! pset_find_ptr(ignore_uses, src) && ! is_End(src)) {
struct out tmp;
- tmp.irn = get_edge_src_irn(edge);
+ tmp.irn = src;
tmp.pos = get_edge_src_pos(edge);
obstack_grow(&obst, &tmp, sizeof(tmp));
n_outs++;
sched_remove(irn);
}
}
-#endif
+#endif /* if 0 */
void be_ssa_constr_phis_ignore(be_dom_front_info_t *info, be_lv_t *lv, int n, ir_node *nodes[], pset *phis, pset *ignore_uses)
{
int save_optimize = get_optimize();
int save_normalize = get_opt_normalize();
int phis_set_created = 0;
- FIRM_DBG_REGISTER(firm_dbg_module_t *dbg, DBG_MODULE);
ir_node *irn;
ir_node *bl = is_Block(pos) ? pos : get_nodes_block(pos);
ir_graph *irg = get_irn_irg(bl);
pset *live = pset_new_ptr_default();
- FIRM_DBG_REGISTER(firm_dbg_module_t *dbg, "be.node");
ir_node *curr, *irn, *perm, **nodes;
int i, n;
}
return changed;
}
+
+void be_init_irgmod(void)
+{
+ FIRM_DBG_REGISTER(dbg, "firm.be.irgmod");
+}
+
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_irgmod);