- set_arch_dep_running(1);
- {
- if (is_Mul(irn) && mode_is_int(mode)) {
- ir_node *left = get_binop_left(irn);
- ir_node *right = get_binop_right(irn);
- tarval *tv = NULL;
- ir_node *operand = NULL;
-
- /* Look, if one operand is a constant. */
- if (is_Const(left)) {
- tv = get_Const_tarval(left);
- operand = right;
- } else if (is_Const(right)) {
- tv = get_Const_tarval(right);
- operand = left;
- }
+ if (!is_Mul(irn) || !mode_is_int(mode))
+ return res;
+
+ /* we should never do the reverse transformations again
+ (like x+x -> 2*x) */
+ irg = get_irn_irg(irn);
+ set_irg_state(irg, IR_GRAPH_STATE_ARCH_DEP);
+
+ left = get_binop_left(irn);
+ right = get_binop_right(irn);
+ tv = NULL;
+ operand = NULL;
+
+ /* Look, if one operand is a constant. */
+ if (is_Const(left)) {
+ tv = get_Const_tarval(left);
+ operand = right;
+ } else if (is_Const(right)) {
+ tv = get_Const_tarval(right);
+ operand = left;
+ }