* by Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick.
* Extended version.
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include "adt/pdeq.h"
#include "iroptimize.h"
#include "irloop_t.h"
#include "array.h"
#include "firmstat.h"
-#include "xmalloc.h"
+#include "error.h"
/** The debug handle. */
DEBUG_ONLY(static firm_dbg_module_t *dbg;)
result = new_rd_Sub(db, irg, block, op1, op2, mode);
break;
default:
- assert(0);
+ panic("Unsupported opcode");
result = NULL;
}
return result;
return 0;
}
+#if 0
/**
* check if a given node is a mul with 2, 4, 8
*/
}
return 0;
}
+#endif
/**
* Check if an IV represents a counter with constant limits.
for (i = 0; i < n; ++i) {
ir_node *pred = get_irn_n(irn, i);
- if (irn_not_visited(pred))
+ if (!irn_visited(pred))
dfs(pred, env);
}
}
push(env, irn);
/* handle the block */
- if (irn_not_visited(block))
+ if (!irn_visited(block))
dfs(block, env);
n = get_irn_arity(irn);
ir_node *pred = get_irn_n(irn, i);
node_entry *o = get_irn_ne(pred, env);
- if (irn_not_visited(pred)) {
+ if (!irn_visited(pred)) {
dfs(pred, env);
node->low = MIN(node->low, o->low);
}
ir_node *end = get_irg_end(irg);
int i, n;
- set_using_irn_visited(irg);
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_VISITED);
current_ir_graph = irg;
inc_irg_visited(irg);
for (i = 0; i < n; ++i) {
ir_node *ka = get_End_keepalive(end, i);
- if (irn_not_visited(ka))
+ if (!irn_visited(ka))
dfs(ka, env);
}
- clear_using_irn_visited(irg);
+ ir_free_resources(irg, IR_RESOURCE_IRN_VISITED);
current_ir_graph = rem;
}
DB((dbg, LEVEL_4, " + %+F", tv_r));
break;
case iro_Sub:
- tv = tarval_sub(tv_l, tv_r);
- tv_init = tarval_sub(tv_init, tv_r);
+ tv = tarval_sub(tv_l, tv_r, NULL);
+ tv_init = tarval_sub(tv_init, tv_r, NULL);
DB((dbg, LEVEL_4, " - %+F", tv_r));
break;
default:
- assert(0);
+ panic("Unsupported opcode");
tv = tarval_bad;
}
tv = tarval_add(tv, tv_incr);
} else {
assert(pscc->code == iro_Sub);
- tv = tarval_sub(tv, tv_incr);
+ tv = tarval_sub(tv, tv_incr, NULL);
}
tarval_set_integer_overflow_mode(ovmode);
DB((dbg, LEVEL_4, " = OVERFLOW"));
return NULL;
}
- return new_r_Const(current_ir_graph, get_irn_n(rc, -1), get_tarval_mode(tv), tv);
+ return new_Const(tv);
}
return do_apply(e->code, NULL, rc, e->rc, get_irn_mode(rc));
}
ir_node *iv, *rc;
ir_node *nleft = NULL, *nright = NULL;
- if (get_irn_op(cmp) != op_Cmp)
+ if (!is_Cmp(cmp))
return;
left = get_Cmp_left(cmp);
if (env.replaced) {
/* try linear function test replacements */
//lftr(irg, &env); // currently buggy :-(
+ (void) lftr;
set_irg_outs_inconsistent(irg);
DB((dbg, LEVEL_1, "Replacements: %u + %u (lftr)\n\n", env.replaced, env.lftr_replaced));