amd64: Spell amd64 as AMD64 in macro names.
[libfirm] / ir / be / beprefalloc.c
index d0080e7..3c6cf50 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -395,26 +381,20 @@ static void create_congruence_class(ir_node *block, void *data)
        be_liveness_end_of_block(lv, cls, block, &live_nodes);
 
        /* check should be same constraints */
-       ir_node *last_phi = NULL;
        sched_foreach_reverse(block, node) {
-               if (is_Phi(node)) {
-                       last_phi = node;
+               if (is_Phi(node))
                        break;
-               }
 
                be_foreach_definition(node, cls, value, req,
                        congruence_def(&live_nodes, value, req);
                );
                be_liveness_transfer(cls, node, &live_nodes);
        }
-       if (!last_phi) {
-               ir_nodeset_destroy(&live_nodes);
-               return;
-       }
 
        /* check phi congruence classes */
-       sched_foreach_reverse_from(last_phi, phi) {
-               assert(is_Phi(phi));
+       sched_foreach(block, phi) {
+               if (!is_Phi(phi))
+                       break;
 
                if (!arch_irn_consider_in_reg_alloc(cls, phi))
                        continue;
@@ -1250,14 +1230,6 @@ static void enforce_constraints(ir_nodeset_t *live_nodes, ir_node *node,
        int res = hungarian_solve(bp, assignment, NULL, 0);
        assert(res == 0);
 
-#if 0
-       fprintf(stderr, "Swap result:");
-       for (i = 0; i < (int) n_regs; ++i) {
-               fprintf(stderr, " %d", assignment[i]);
-       }
-       fprintf(stderr, "\n");
-#endif
-
        hungarian_free(bp);
 
        permute_values(live_nodes, node, assignment);