#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"
*/
-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_graph *irg = get_irn_irg(bl);
ir_nodeset_t live;
ir_nodeset_iterator_t iter;
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;
}
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);
ir_node *pred;
ir_node *succ_block;
ir_node *jump = NULL;
+ ir_graph *irg = get_irn_irg(block);
if (irn_visited_else_mark(block))
return;
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 */
if (node == jump)
continue;
- if (is_Block(node)) {
- /* a Block->Block edge: This should be the MacroBlock
- edge, ignore it. */
- assert(get_Block_MacroBlock(node) == block && "Wrong Block->Block edge");
- continue;
- }
/* we simply kill Pins, because there are some strange interactions
- * between condeval, which produce PhiMs with Pins, we simply kill
- * the pins here, everything is scheduled anyway */
+ * between jump threading, which produce PhiMs with Pins, we simply
+ * kill the pins here, everything is scheduled anyway */
if (is_Pin(node)) {
exchange(node, get_Pin_op(node));
continue;
panic("Unexpected node %+F in block %+F with empty schedule", node, block);
}
- set_Block_cfgpred(block, 0, new_Bad());
+ set_Block_cfgpred(block, 0, new_r_Bad(irg));
kill_node(jump);
blocks_removed = 1;
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);
}
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);