int
get_Block_matured(ir_node *node) {
assert(node->op == op_Block);
- return (int)node->attr.block.matured;
+ return (int)node->attr.block.is_matured;
}
void
set_Block_matured(ir_node *node, int matured) {
assert(node->op == op_Block);
- node->attr.block.matured = matured;
+ node->attr.block.is_matured = matured;
}
unsigned long
node->attr.block.graph_arr[pos+1] = value;
}
-void set_Block_cg_cfgpred_arr(ir_node * node, int arity, ir_node ** in) {
+void set_Block_cg_cfgpred_arr(ir_node *node, int arity, ir_node *in[]) {
assert(node->op == op_Block);
if (node->attr.block.in_cg == NULL || arity != ARR_LEN(node->attr.block.in_cg) - 1) {
node->attr.block.in_cg = NEW_ARR_D(ir_node *, current_ir_graph->obst, arity + 1);
memcpy(node->attr.block.in_cg + 1, in, sizeof(ir_node *) * arity);
}
-void set_Block_cg_cfgpred(ir_node * node, int pos, ir_node * pred) {
+void set_Block_cg_cfgpred(ir_node *node, int pos, ir_node *pred) {
assert(node->op == op_Block &&
node->attr.block.in_cg &&
0 <= pos && pos < ARR_LEN(node->attr.block.in_cg) - 1);
node->attr.block.in_cg[pos + 1] = pred;
}
-ir_node **get_Block_cg_cfgpred_arr(ir_node * node) {
+ir_node **get_Block_cg_cfgpred_arr(ir_node *node) {
assert(node->op == op_Block);
return node->attr.block.in_cg == NULL ? NULL : node->attr.block.in_cg + 1;
}
-int get_Block_cg_n_cfgpreds(ir_node * node) {
+int get_Block_cg_n_cfgpreds(ir_node *node) {
assert(node->op == op_Block);
return node->attr.block.in_cg == NULL ? 0 : ARR_LEN(node->attr.block.in_cg) - 1;
}
-ir_node *get_Block_cg_cfgpred(ir_node * node, int pos) {
+ir_node *get_Block_cg_cfgpred(ir_node *node, int pos) {
assert(node->op == op_Block && node->attr.block.in_cg);
return node->attr.block.in_cg[pos + 1];
}
-void remove_Block_cg_cfgpred_arr(ir_node * node) {
+void remove_Block_cg_cfgpred_arr(ir_node *node) {
assert(node->op == op_Block);
node->attr.block.in_cg = NULL;
}
block->attr.block.extblk = extblk;
}
+ir_node *get_Block_MacroBlock(const ir_node *block) {
+ assert(is_Block(block));
+ return get_irn_n(block, -1);
+}
+
int
get_End_n_keepalives(ir_node *end) {
assert(end->op == op_End);
}
void
-add_End_keepalive (ir_node *end, ir_node *ka) {
+add_End_keepalive(ir_node *end, ir_node *ka) {
assert(end->op == op_End);
assert((is_Phi(ka) || is_Proj(ka) || is_Block(ka) || is_irn_keep(ka)) && "Only Phi, Block or Keep nodes can be kept alive!");
add_irn_n(end, ka);
ir_node *get_fragile_op_mem(ir_node *node) {
assert(node && is_fragile_op(node));
- switch (get_irn_opcode (node)) {
+ switch (get_irn_opcode(node)) {
case iro_Call :
case iro_Quot :
case iro_DivMod:
}
}
+/* Returns the result mode of a Div operation. */
+ir_mode *get_divop_resmod(const ir_node *node) {
+ switch (get_irn_opcode(node)) {
+ case iro_Quot : return get_Quot_resmode(node);
+ case iro_DivMod: return get_DivMod_resmode(node);
+ case iro_Div : return get_Div_resmode(node);
+ case iro_Mod : return get_Mod_resmode(node);
+ default: ;
+ assert(0 && "should not be reached");
+ return NULL;
+ }
+}
+
/* Returns true if the operation is a forking control flow operation. */
int (is_irn_forking)(const ir_node *node) {
return _is_irn_forking(node);
}
/* Returns the conditional jump prediction of a Cond node. */
-cond_jmp_predicate (get_Cond_jmp_pred)(ir_node *cond) {
+cond_jmp_predicate (get_Cond_jmp_pred)(const ir_node *cond) {
return _get_Cond_jmp_pred(cond);
}
* predecessors are removed, the node has the same predecessors in
* both views.
* @@@ Maybe better: arity is zero if no cg preds. */
-void set_Block_cg_cfgpred_arr(ir_node *node, int arity, ir_node **in);
+void set_Block_cg_cfgpred_arr(ir_node *node, int arity, ir_node *in[]);
void set_Block_cg_cfgpred(ir_node *node, int pos, ir_node *pred);
/* @@@ not supported */
ir_node **get_Block_cg_cfgpred_arr(ir_node *node);
/** Sets the extended basic block a block belongs to. */
void set_Block_extbb(ir_node *block, ir_extblk *extblk);
+/** Get the Macro Block header of a (sub-) block. */
+ir_node *get_Block_MacroBlock(const ir_node *block);
+
/** Return the number of Keep alive node. */
int get_End_n_keepalives(ir_node *end);
int is_fragile_op(const ir_node *node);
/** Returns the memory operand of fragile operations. */
ir_node *get_fragile_op_mem(ir_node *node);
+/** Returns the result mode of a Div operation. */
+ir_mode *get_divop_resmod(const ir_node *node);
/** Returns true if the operation is a forking control flow
* operation: Cond. */
const char *get_cond_jmp_predicate_name(cond_jmp_predicate pred);
/** Returns the conditional jump prediction of a Cond node. */
-cond_jmp_predicate get_Cond_jmp_pred(ir_node *cond);
+cond_jmp_predicate get_Cond_jmp_pred(const ir_node *cond);
/** Sets a new conditional jump prediction. */
void set_Cond_jmp_pred(ir_node *cond, cond_jmp_predicate pred);
ir_graph *irg; /**< The graph this block belongs to. */
unsigned long block_visited; /**< For the walker that walks over all blocks. */
/* Attributes private to construction: */
- unsigned matured:1; /**< If set, all in-nodes of the block are fixed. */
- unsigned dead:1; /**< If set, the block is dead (and could be replace by a Bad. */
+ unsigned is_matured:1; /**< If set, all in-nodes of the block are fixed. */
+ unsigned is_dead:1; /**< If set, the block is dead (and could be replace by a Bad. */
+ unsigned is_mb_head:1; /**< Set if this block is a macroblock head. */
ir_node **graph_arr; /**< An array to store all parameters. */
/* Attributes holding analyses information */
ir_dom_info dom; /**< Datastructure that holds information about dominators.
@@@ @todo Ev. replace by bit field! */
ir_extblk *extblk; /**< The extended basic block this block belongs to. */
ir_region *region; /**< The immediate structural region this block belongs to. */
+ unsigned mb_depth; /**< The macroblock depth: A distance from the macroblock header */
struct list_head succ_head; /**< A list head for all successor edges of a block. */
} block_attr;
static INLINE ir_node *
_set_Block_dead(ir_node *block) {
assert(_get_irn_op(block) == op_Block);
- block->attr.block.dead = 1;
+ block->attr.block.is_dead = 1;
return block;
}
return 1;
else {
assert(op == op_Block);
- return block->attr.block.dead;
+ return block->attr.block.is_dead;
}
}
return is_op_machine_user(_get_irn_op(node), n);
}
-static INLINE cond_jmp_predicate _get_Cond_jmp_pred(ir_node *node) {
+static INLINE cond_jmp_predicate _get_Cond_jmp_pred(const ir_node *node) {
assert(_get_irn_op(node) == op_Cond);
return node->attr.cond.pred;
}