static ir_node *equivalent_node_symmetric_unop(ir_node *n)
{
ir_node *oldn = n;
+ ir_node *pred = get_unop_op(n);
/* optimize symmetric unop */
- if (get_irn_op(get_unop_op(n)) == get_irn_op(n)) {
- n = get_unop_op(get_unop_op(n)); DBG_OPT_ALGSIM2;
+ if (get_irn_op(pred) == get_irn_op(n)) {
+ n = get_unop_op(pred); DBG_OPT_ALGSIM2;
}
return n;
}
return get_Cast_type(a) != get_Cast_type(b);
}
+static int node_cmp_attr_Load(ir_node *a, ir_node *b)
+{
+ if (get_Load_volatility(a) == volatility_is_volatile ||
+ get_Load_volatility(b) == volatility_is_volatile)
+ /* NEVER do CSE on volatile Loads */
+ return 1;
+
+ return get_Load_mode(a) != get_Load_mode(b);
+}
+
+static int node_cmp_attr_Store(ir_node *a, ir_node *b)
+{
+ /* NEVER do CSE on volatile Stores */
+ return (get_Store_volatility(a) == volatility_is_volatile ||
+ get_Load_volatility(b) == volatility_is_volatile);
+}
+
/**
* set the default node attribute compare operation
*/
CASE(Sel);
CASE(Phi);
CASE(Cast);
+ CASE(Load);
+ CASE(Store);
default:
op->node_cmp_attr = NULL;
}