fix debug name
[libfirm] / ir / be / ia32 / ia32_address_mode.c
index b186b55..cac9938 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -90,7 +90,8 @@ static int do_is_immediate(const ir_node *node, int *symconsts, int negate)
                return 1;
        case iro_Add:
        case iro_Sub:
-               /* Add's and Sub's are typically supported as long as both operands are immediates */
+               /* Add's and Sub's are typically supported as long as both operands are
+                * immediates */
                if(bitset_is_set(non_address_mode_nodes, get_irn_idx(node)))
                        return 0;
 
@@ -483,7 +484,11 @@ static void mark_non_address_nodes(ir_node *node, void *env)
                left  = get_binop_left(node);
                right = get_binop_right(node);
 
-               if (!value_last_used_here(node, left) &&
+               /* Fold AM if any of the two operands does not die here.  This duplicates
+                * an addition and has the same register pressure for the case that only
+                * one operand dies, but is faster (on Pentium 4).
+                * && instead of || only folds AM if both operands do not die here */
+               if (!value_last_used_here(node, left) ||
                                !value_last_used_here(node, right)) {
                        return;
                }