* gives a (conservative) estimation of possible relation when comparing
* left+right
*/
-static ir_relation determine_possible_cmp_relations(const ir_node *left,
- const ir_node *right)
+ir_relation ir_get_possible_cmp_relations(const ir_node *left,
+ const ir_node *right)
{
ir_relation possible = ir_relation_true;
ir_tarval *tv_l = value_of(left);
{
ir_node *left = get_Cmp_left(cmp);
ir_node *right = get_Cmp_right(cmp);
- ir_relation possible = determine_possible_cmp_relations(left, right);
+ ir_relation possible = ir_get_possible_cmp_relations(left, right);
ir_relation relation = get_Cmp_relation(cmp);
/* if none of the requested relations is possible, return false */
ir_tarval *tv;
if (a == b) {
- n = a; /* Or has it's own neutral element */
+ n = a; /* idempotence */
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_OR);
return n;
}
- /* constants are cormalized to right, check this site first */
+ /* constants are normalized to right, check this side first */
tv = value_of(b);
if (tarval_is_null(tv)) {
n = a;
ir_tarval *tv;
if (a == b) {
- n = a; /* And has it's own neutral element */
+ n = a; /* idempotence */
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_AND);
return n;
}
- /* constants are normalized to right, check this site first */
+ /* constants are normalized to right, check this side first */
tv = value_of(b);
if (tarval_is_all_one(tv)) {
n = a;
first_val = get_Phi_pred(n, i);
if ( (first_val != n) /* not self pointer */
#if 0
- /* BEWARE: when the if is changed to 1, Phi's will ignore it's Bad
- * predecessors. Then, Phi nodes in dead code might be removed, causing
- * nodes pointing to themself (Add's for instance).
- * This is really bad and causes endless recursions in several
- * code pathes, so we do NOT optimize such a code.
+ /* BEWARE: when the if is changed to 1, Phis will ignore their Bad
+ * predecessors. Then, Phi nodes in unreachable code might be removed,
+ * causing nodes pointing to themselev (Adds for instance).
+ * This is really bad and causes endless recursion on several
+ * code pathes, so we do NOT optimize such code.
* This is not that bad as it sounds, optimize_cf() removes bad control flow
* (and bad Phi predecessors), so live code is optimized later.
*/
} /* equivalent_node_Proj_Store */
/**
- * Does all optimizations on nodes that must be done on it's Proj's
+ * Does all optimizations on nodes that must be done on its Projs
* because of creating new nodes.
*/
static ir_node *equivalent_node_Proj(ir_node *proj)
bool changed = false;
bool changedc = false;
ir_relation relation = get_Cmp_relation(n);
- ir_relation possible = determine_possible_cmp_relations(left, right);
+ ir_relation possible = ir_get_possible_cmp_relations(left, right);
/* mask out impossible relations */
ir_relation new_relation = relation & possible;
} /* transform_node_Proj_Bound */
/**
- * Does all optimizations on nodes that must be done on it's Proj's
+ * Does all optimizations on nodes that must be done on its Projs
* because of creating new nodes.
*/
static ir_node *transform_node_Proj(ir_node *proj)
/* Note: the obvious rot formulation (a << x) | (a >> (32-x)) gets
* transformed to (a << x) | (a >> -x) by transform_node_shift_modulo() */
- if (!is_negated_value(c1, c2)) {
+ if (!ir_is_negated_value(c1, c2)) {
return irn_or;
}
return n;
} /* transform_node_End */
-bool is_negated_value(ir_node *a, ir_node *b)
+int ir_is_negated_value(const ir_node *a, const ir_node *b)
{
if (is_Minus(a) && get_Minus_op(a) == b)
return true;
ir_graph *irg;
type_dbg_info *tdb;
dbg_info *db;
- int i, n_res, n_param;
+ size_t i, n_res, n_param;
ir_variadicity var;
if (! is_Proj(callee))
#if 0
/* Propagating Unknowns here seems to be a bad idea, because
sometimes we need a node as a input and did not want that
- it kills it's user.
+ it kills its user.
However, it might be useful to move this into a later phase
(if you think that optimizing such code is useful). */
if (is_Unknown(pred) && mode_is_data(get_irn_mode(node)))
size_t node_size;
/*
- * we MUST copy the node here temporary, because it's still
+ * we MUST copy the node here temporarily, because it's still
* needed for DBG_OPT_CSTEVAL
*/
node_size = offsetof(ir_node, attr) + n->op->attr_size;