summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bestate.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-11-29 08:37:12 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-11-29 08:37:12 +0100
commit138b6f7fefad82016bec93c97de31397d1762f4b (patch)
tree4252b3b6c42f3f1924901512e6fe736e6d0ea592 /ir/be/bestate.c
parente1e6b4bedd6f3d1b631a0cb496f795a9c2aa9980 (diff)
bestate: Use be_get_end_of_block_insertion_point() instead of implementing something not entierly unlike it.
Diffstat (limited to 'ir/be/bestate.c')
-rw-r--r--ir/be/bestate.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/ir/be/bestate.c b/ir/be/bestate.c
index a15a61c..672e1ce 100644
--- a/ir/be/bestate.c
+++ b/ir/be/bestate.c
@@ -48,6 +48,7 @@
#include "bemodule.h"
#include "benode.h"
#include "beirgmod.h"
+#include "bespillutil.h"
#include "bessaconstr.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
@@ -429,24 +430,6 @@ static void belady_walker(ir_node *block, void *data)
belady((minibelady_env_t*) data, block);
}
-static ir_node *get_end_of_block_insertion_point(ir_node *block)
-{
- ir_node *last = sched_last(block);
-
- /* skip Projs and Keep-alikes behind the jump... */
- while (is_Proj(last) || be_is_Keep(last)) {
- last = sched_prev(last);
- }
-
- if (!is_cfop(last)) {
- last = sched_next(last);
- /* last node must be a cfop, only exception is the start block */
- assert(last == get_irg_start_block(get_irn_irg(block)));
- }
-
- return last;
-}
-
/**
* We must adapt the live-outs to the live-ins at each block-border.
*/
@@ -487,10 +470,8 @@ static void fix_block_borders(ir_node *block, void *data)
pred_info->end_state, need_state));
if (pred_info->end_state != need_state) {
- ir_node *insert_point = get_end_of_block_insertion_point(pred);
-
-
DBG((dbg, LEVEL_3, " Creating reload for %+F\n", need_state));
+ ir_node *const insert_point = be_get_end_of_block_insertion_point(pred);
create_reload(env, need_state, insert_point, pred_info->end_state);
}
}