X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeirgmod.c;h=9b3bb7896e83c13d924e4c5fa7c44554cd219329;hb=b73885353bbb0407d29986b83e8e76429a7cb25d;hp=393ba5829be7592872cd052a45b5719e7d5c192a;hpb=7213344d377bb242491dfb0c291b43157c3c81d6;p=libfirm diff --git a/ir/be/beirgmod.c b/ir/be/beirgmod.c index 393ba5829..9b3bb7896 100644 --- a/ir/be/beirgmod.c +++ b/ir/be/beirgmod.c @@ -57,14 +57,14 @@ #include "be_t.h" #include "bechordal_t.h" -#include "bearch_t.h" -#include "besched_t.h" +#include "bearch.h" +#include "besched.h" #include "belive_t.h" -#include "benode_t.h" +#include "benode.h" #include "beutil.h" #include "beinsn_t.h" #include "bessaconstr.h" -#include "beirg_t.h" +#include "beirg.h" #include "beirgmod.h" #include "bemodule.h" @@ -79,11 +79,10 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) */ -ir_node *insert_Perm_after(be_irg_t *birg, - const arch_register_class_t *cls, +ir_node *insert_Perm_after(ir_graph *irg, const arch_register_class_t *cls, ir_node *pos) { - be_lv_t *lv = birg->lv; + be_lv_t *lv = be_get_irg_liveness(irg); ir_node *bl = is_Block(pos) ? pos : get_nodes_block(pos); ir_nodeset_t live; ir_nodeset_iterator_t iter; @@ -97,7 +96,7 @@ ir_node *insert_Perm_after(be_irg_t *birg, be_liveness_nodes_live_at(lv, cls, pos, &live); n = ir_nodeset_size(&live); - if(n == 0) { + if (n == 0) { ir_nodeset_destroy(&live); return NULL; } @@ -124,12 +123,12 @@ ir_node *insert_Perm_after(be_irg_t *birg, be_ssa_construction_env_t senv; ir_mode *mode = get_irn_mode(perm_op); - ir_node *proj = new_r_Proj(bl, perm, mode, i); + ir_node *proj = new_r_Proj(perm, mode, i); arch_set_irn_register(proj, reg); curr = proj; - be_ssa_construction_init(&senv, birg); + be_ssa_construction_init(&senv, irg); be_ssa_construction_add_copy(&senv, perm_op); be_ssa_construction_add_copy(&senv, proj); be_ssa_construction_fix_users(&senv, perm_op); @@ -164,7 +163,8 @@ static void remove_empty_block(ir_node *block) goto check_preds; sched_foreach(block, node) { - if (! is_Jmp(node)) + if (! is_Jmp(node) + && !(arch_irn_get_flags(node) & arch_irn_flags_simple_jump)) goto check_preds; if (jump != NULL) { /* we should never have 2 jumps in a block */ @@ -242,7 +242,7 @@ static void remove_empty_block(ir_node *block) check_preds: arity = get_Block_n_cfgpreds(block); - for(i = 0; i < arity; ++i) { + for (i = 0; i < arity; ++i) { ir_node *pred = get_Block_cfgpred_block(block, i); remove_empty_block(pred); } @@ -279,9 +279,8 @@ int be_remove_empty_blocks(ir_graph *irg) return blocks_removed; } +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_irgmod); void be_init_irgmod(void) { FIRM_DBG_REGISTER(dbg, "firm.be.irgmod"); } - -BE_REGISTER_MODULE_CONSTRUCTOR(be_init_irgmod);