------- Comment #14 from bonzini at gnu dot org  2009-02-05 13:02 -------
20% of PRE time is spent in qsort via sorted_array_from_bitmap_set.  Rewriting
it like this makes it a bit faster (it shaves 12% more of PRE time):

  FOR_EACH_VALUE_ID_IN_SET (set, i, bi)
    {
      /* The number of expressions having a given value is usually
         relatively small.  Thus, rather than making a vector of all the
         expressions and sorting it by value id, we walk the values and
         check in the reverse mapping that tells us what expressions have
         a given value, to filter those in our set.  If this is somehow
         a significant lose for some cases, we can choose which set to
         walk based on the set size.  */
      bitmap_set_t exprset = VEC_index (bitmap_set_t, value_expressions, i);
      FOR_EACH_EXPR_ID_IN_SET (exprset, j, bj)
        {
          if (bitmap_bit_p (set->expressions, j))
            VEC_safe_push (pre_expr, heap, result, expression_for_id (j));
        }
    }

I'll add this to the bootstrap/regtest.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35639

Reply via email to