summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bepbqpcoloring.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-11-28 20:16:27 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-11-28 23:42:46 +0100
commit40db13dafa724caf3f38f76539cf107cd4c1a376 (patch)
treeefab3a5fb988ec6d383856cc8ac844498ce19562 /ir/be/bepbqpcoloring.c
parent21859ae93493117ea48653347ddc6307be93e16f (diff)
bearch: Add and use be_foreach_value().
This also handles the latent problem, that nobody checks, whether the user of a tuple is actually a Proj and not the End node.
Diffstat (limited to 'ir/be/bepbqpcoloring.c')
-rw-r--r--ir/be/bepbqpcoloring.c60
1 files changed, 15 insertions, 45 deletions
diff --git a/ir/be/bepbqpcoloring.c b/ir/be/bepbqpcoloring.c
index 940e031..f9de569 100644
--- a/ir/be/bepbqpcoloring.c
+++ b/ir/be/bepbqpcoloring.c
@@ -332,57 +332,27 @@ static void create_pbqp_coloring_instance(ir_node *block, void *data)
/* create pbqp nodes, interference edges and reverse perfect elimination order */
sched_foreach_reverse(block, irn) {
- if (get_irn_mode(irn) == mode_T) {
- foreach_out_edge(irn, edge) {
- ir_node *proj = get_edge_src_irn(edge);
- if (!arch_irn_consider_in_reg_alloc(cls, proj))
- continue;
-
- /* create pbqp source node if it dosn't exist */
- if (get_node(pbqp_inst, get_irn_idx(proj)) == NULL) {
- create_pbqp_node(pbqp_alloc_env, proj);
- }
-
- /* create nodes and interference edges */
- foreach_ir_nodeset(&live_nodes, live, iter) {
- /* create pbqp source node if it dosn't exist */
- if (get_node(pbqp_inst, get_irn_idx(live)) == NULL) {
- create_pbqp_node(pbqp_alloc_env, live);
- }
+ be_foreach_value(irn, value,
+ if (!arch_irn_consider_in_reg_alloc(cls, value))
+ continue;
- /* no edges to itself */
- if (proj == live) {
- continue;
- }
+ /* create pbqp source node if it dosn't exist */
+ if (!get_node(pbqp_inst, get_irn_idx(value)))
+ create_pbqp_node(pbqp_alloc_env, value);
- insert_ife_edge(pbqp_alloc_env, proj, live);
- }
- }
- }
- else {
- if (arch_irn_consider_in_reg_alloc(cls, irn)) {
+ /* create nodes and interference edges */
+ foreach_ir_nodeset(&live_nodes, live, iter) {
/* create pbqp source node if it dosn't exist */
- if (get_node(pbqp_inst, get_irn_idx(irn)) == NULL) {
- create_pbqp_node(pbqp_alloc_env, irn);
- }
-
- /* create nodes and interference edges */
- foreach_ir_nodeset(&live_nodes, live, iter) {
- /* create pbqp source node if it dosn't exist */
- if (get_node(pbqp_inst, get_irn_idx(live)) == NULL) {
- create_pbqp_node(pbqp_alloc_env, live);
- }
+ if (!get_node(pbqp_inst, get_irn_idx(live)))
+ create_pbqp_node(pbqp_alloc_env, live);
- /* no edges to itself */
- if (irn == live) {
- continue;
- }
+ /* no edges to itself */
+ if (value == live)
+ continue;
- /* insert interference edge */
- insert_ife_edge(pbqp_alloc_env, irn, live);
- }
+ insert_ife_edge(pbqp_alloc_env, value, live);
}
- }
+ );
/* get living nodes for next step */
if (!is_Phi(irn)) {