projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
old_bp should not be part of the between type, this fixes stack alignment for functio...
[libfirm]
/
ir
/
be
/
beblocksched.c
diff --git
a/ir/be/beblocksched.c
b/ir/be/beblocksched.c
index
507fc07
..
f089625
100644
(file)
--- a/
ir/be/beblocksched.c
+++ b/
ir/be/beblocksched.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-200
7
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-200
8
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-59,9
+59,8
@@
#include "bemodule.h"
#include "be.h"
#include "bemodule.h"
#include "be.h"
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-#include <libcore/lc_timing.h>
+#include "lc_opts.h"
+#include "lc_opts_enum.h"
#ifdef WITH_ILP
#include <lpp/lpp.h>
#ifdef WITH_ILP
#include <lpp/lpp.h>
@@
-147,8
+146,10
@@
static void collect_egde_frequency(ir_node *block, void *data)
arity = get_Block_n_cfgpreds(block);
if (arity == 0) {
arity = get_Block_n_cfgpreds(block);
if (arity == 0) {
- assert(block == get_irg_start_block(env->irg));
- /* must be the start block, nothing to do here */
+ assert(block == get_irg_start_block(env->irg)
+ || block == get_irg_end_block(env->irg));
+ /* must be the start block (or end-block for endless loops), nothing to
+ * do here */
return;
} else if (arity == 1) {
edge.block = block;
return;
} else if (arity == 1) {
edge.block = block;
@@
-201,18
+202,19
@@
static void coalesce_blocks(blocksched_env_t *env)
for (i = 0; i < edge_count; ++i) {
const edge_t *edge = &env->edges[i];
ir_node *block = edge->block;
for (i = 0; i < edge_count; ++i) {
const edge_t *edge = &env->edges[i];
ir_node *block = edge->block;
+ int pos = edge->pos;
ir_node *pred_block;
blocksched_entry_t *entry, *pred_entry;
ir_node *pred_block;
blocksched_entry_t *entry, *pred_entry;
- /* the block might have been removed already... */
- if (is_Bad(get_Block_cfgpred(block, 0)))
- continue;
-
/* only check edge with highest frequency */
if (! edge->highest_execfreq)
continue;
/* only check edge with highest frequency */
if (! edge->highest_execfreq)
continue;
- pred_block = get_Block_cfgpred_block(block, edge->pos);
+ /* the block might have been removed already... */
+ if (is_Bad(get_Block_cfgpred(block, 0)))
+ continue;
+
+ pred_block = get_Block_cfgpred_block(block, pos);
entry = get_irn_link(block);
pred_entry = get_irn_link(pred_block);
entry = get_irn_link(block);
pred_entry = get_irn_link(pred_block);
@@
-242,8
+244,8
@@
static void coalesce_blocks(blocksched_env_t *env)
if (is_Bad(get_Block_cfgpred(block, 0)))
continue;
if (is_Bad(get_Block_cfgpred(block, 0)))
continue;
- /* we can't fallthroughs in backedges */
- if (is_backedge(block,
edge->
pos))
+ /* we can't
do
fallthroughs in backedges */
+ if (is_backedge(block, pos))
continue;
pred_block = get_Block_cfgpred_block(block, pos);
continue;
pred_block = get_Block_cfgpred_block(block, pos);
@@
-359,7
+361,7
@@
static blocksched_entry_t *finish_block_schedule(blocksched_env_t *env)
ir_node *startblock = get_irg_start_block(irg);
blocksched_entry_t *entry = get_irn_link(startblock);
ir_node *startblock = get_irg_start_block(irg);
blocksched_entry_t *entry = get_irn_link(startblock);
-
set_using_visited(irg
);
+
ir_reserve_resources(irg, IR_RESOURCE_IRN_VISITED
);
inc_irg_visited(irg);
env->worklist = new_pdeq();
inc_irg_visited(irg);
env->worklist = new_pdeq();
@@
-367,7
+369,7
@@
static blocksched_entry_t *finish_block_schedule(blocksched_env_t *env)
assert(pdeq_empty(env->worklist));
del_pdeq(env->worklist);
assert(pdeq_empty(env->worklist));
del_pdeq(env->worklist);
-
clear_using_visited(irg
);
+
ir_free_resources(irg, IR_RESOURCE_IRN_VISITED
);
return entry;
}
return entry;
}
@@
-710,8
+712,7
@@
static ir_node **create_extbb_block_schedule(ir_graph *irg, ir_exec_freq *execfr
list.end = NULL;
list.n_blks = 0;
list.end = NULL;
list.n_blks = 0;
- set_using_irn_link(irg);
- set_using_visited(irg);
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_VISITED | IR_RESOURCE_IRN_LINK);
inc_irg_block_visited(irg);
create_block_list(get_irg_start_block(irg), &list);
inc_irg_block_visited(irg);
create_block_list(get_irg_start_block(irg), &list);
@@
-724,8
+725,7
@@
static ir_node **create_extbb_block_schedule(ir_graph *irg, ir_exec_freq *execfr
blk_list[i] = b;
}
blk_list[i] = b;
}
- clear_using_irn_link(irg);
- clear_using_visited(irg);
+ ir_free_resources(irg, IR_RESOURCE_IRN_VISITED | IR_RESOURCE_IRN_LINK);
return blk_list;
}
return blk_list;
}