summaryrefslogtreecommitdiffhomepage
path: root/ir/opt
diff options
context:
space:
mode:
authorElias Aebi <elias.aebi@student.kit.edu>2018-04-04 13:13:49 +0200
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2019-01-24 17:42:00 +0100
commitbb129c87fee85d84c694f58f613c0eabf2935f68 (patch)
treefd1cdadb5ecf799981b3527d8e3b41d301cf9718 /ir/opt
parentb058c7bd5292afd4bde350afaeb17365598669e6 (diff)
use the debug macro
Diffstat (limited to 'ir/opt')
-rw-r--r--ir/opt/lcssa.c2
-rw-r--r--ir/opt/loop2.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/ir/opt/lcssa.c b/ir/opt/lcssa.c
index c213285..f217853 100644
--- a/ir/opt/lcssa.c
+++ b/ir/opt/lcssa.c
@@ -30,7 +30,7 @@ static ir_node *insert_phi(ir_node *const node, int const n, ir_node *const bloc
set_optimize(opt);
set_irn_n(node, n, phi);
mark_irn_visited(phi);
- DB((dbg, LEVEL_3, "inserting phi %ld\n", get_irn_node_nr(phi)));
+ DB((dbg, LEVEL_3, "inserting phi %N\n", phi));
return phi;
}
diff --git a/ir/opt/loop2.c b/ir/opt/loop2.c
index e1332c4..b07f9d2 100644
--- a/ir/opt/loop2.c
+++ b/ir/opt/loop2.c
@@ -1,8 +1,11 @@
#include "lcssa_t.h"
#include "irtools.h"
#include "xmalloc.h"
+#include "debug.h"
#include <assert.h>
+DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
+
static void walk_loop(ir_loop *const loop, irg_walk_func *const func, void *const env)
{
size_t const n_elements = get_loop_n_elements(loop);
@@ -78,15 +81,11 @@ static ir_node *get_loop_header(ir_loop *const loop)
static void duplicate_node(ir_node *const node, ir_node *const new_block)
{
- //ir_printf("duplicate node %n (%d)\n", node, get_irn_node_nr(node));
- //int const opt = get_optimize();
- //set_optimize(0);
ir_node *const new_node = exact_copy(node);
- //set_optimize(opt);
set_nodes_block(new_node, new_block);
set_irn_link(node, new_node);
set_irn_link(new_node, node);
- //printf("new node %ld\n", get_irn_node_nr(new_node));
+ DB((dbg, LEVEL_3, "duplicating node %N (%n), new node %N\n", node, node, new_node));
}
static void rewire_node(ir_node *const node, ir_node *const header)
@@ -173,6 +172,8 @@ static void duplicate_block(ir_node *const block)
ir_node *const new_block = exact_copy(block);
set_irn_link(block, new_block);
set_irn_link(new_block, block);
+ DB((dbg, LEVEL_3, "duplicating block %N, new block %N\n", block, new_block));
+
unsigned int const n_outs = get_irn_n_outs(block);
for (unsigned int i = 0; i < n_outs; ++i) {
ir_node *const node = get_irn_out(block, i);
@@ -237,6 +238,7 @@ static void duplicate_one_loop(ir_loop *const loop, bool outermost)
void do_loop_unrolling2(ir_graph *const irg)
{
+ FIRM_DBG_REGISTER(dbg, "firm.opt.loop-unrolling");
assure_lcssa(irg);
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO | IR_GRAPH_PROPERTY_CONSISTENT_OUTS);
ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);