#include "irgmod.h"
#include "iropt_dbg.h"
#include "iredges_t.h"
+#include "irgwalk.h"
#include "irprintf.h"
/**
*
* @param block the block which is entered by the branch
* @param irn the node expressing the switch value
- * @param pnc the branch label
+ * @param nr the branch label
* @param env statistical environment
*
* Branch labels are a simple case. We can replace the value
if (! c) {
ir_mode *mode = get_irn_mode(irn);
- type *tp = get_irn_type(irn);
+ ir_type *tp = get_irn_type(irn);
tarval *tv = new_tarval_from_long(nr, mode);
c = new_r_Const_type(current_ir_graph, block, mode, tv, tp);
}
{
ir_node *left = get_Cmp_left(cmp);
ir_node *right = get_Cmp_right(cmp);
- ir_op *op;
+ ir_op *op;
const ir_edge_t *edge, *next;
/* Beware of Bads */
op = get_irn_op(left);
+ /* Do not create Confirm nodes for Cmp(Const, Const) constructs.
+ These are removed anyway */
+ if (op == op_Const && is_Const(right))
+ return;
+
/* try to place the constant on the right side for a Confirm */
if (op == op_Const || op == op_SymConst) {
ir_node *t = left;
env_t env;
int edges_active = edges_activated(irg);
- if (get_irg_dom_state(irg) != dom_consistent) {
- /* we need dominance info */
- compute_doms(irg);
- }
+ /* we need dominance info */
+ assure_doms(irg);
assert(get_irg_pinned(irg) == op_pin_state_pinned &&
"Nodes must be placed to insert Confirms");