ia32: Fix calculation bug in ia32_get_op_estimated_cost() of the latency of CopyB_i.
[libfirm] / ir / be / beschedregpress.c
index f2767af..a776409 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2008 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.
  */
 
 /**
@@ -54,34 +40,6 @@ typedef struct {
 } reg_pressure_selector_env_t;
 
 
-#if 0
-/*
-* Ugly global variable for the compare function
-* since qsort(3) does not pass an extra pointer.
-*/
-static ir_node *curr_bl = NULL;
-
-static int cmp_usage(const void *a, const void *b)
-{
-       struct trivial_sched_env *env;
-       const ir_node *p = a;
-       const ir_node *q = b;
-       int res = 0;
-
-       res = is_live_end(env->curr_bl, a) - is_live_end(env->curr_bl, b);
-
-       /*
-       * One of them is live at the end of the block.
-       * Then, that one shall be scheduled at after the other
-       */
-       if (res != 0)
-               return res;
-
-
-       return res;
-}
-#endif
-
 static inline usage_stats_t *get_or_set_usage_stats(reg_pressure_selector_env_t *env, ir_node *irn)
 {
        usage_stats_t *us = (usage_stats_t*)get_irn_link(irn);
@@ -185,19 +143,9 @@ static void *reg_pressure_block_init(void *graph_env, ir_node *bl)
        * Collect usage statistics.
        */
        sched_foreach(bl, irn) {
-               int i, n;
-               if (is_Proj(irn)
-                               || (arch_get_irn_flags(irn) & arch_irn_flags_not_scheduled))
-                       continue;
-
-               for (i = 0, n = get_irn_arity(irn); i < n; ++i) {
+               for (int i = 0, n = get_irn_arity(irn); i < n; ++i) {
                        usage_stats_t *us = get_or_set_usage_stats(env, irn);
-#if 0 /* Liveness is not computed here! */
-                       if (is_live_end(bl, op))
-                               us->uses_in_block = 99999;
-                       else
-#endif
-                               us->uses_in_block++;
+                       us->uses_in_block++;
                }
        }