https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90877

            Bug ID: 90877
           Summary: Dead codes in ix86_register_move_cost
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: skpgkp1 at gmail dot com, ubizjak at gmail dot com
  Target Milestone: ---

ix86_register_move_cost has

  if (inline_secondary_memory_needed (mode, class1, class2, false))
    {
       ...
       return cost;
    }

 /* Moves between SSE/MMX and integer unit are expensive.  */
  if (MMX_CLASS_P (class1) != MMX_CLASS_P (class2)
      || SSE_CLASS_P (class1) != SSE_CLASS_P (class2))

   /* ??? By keeping returned value relatively high, we limit the number
       of moves between integer and MMX/SSE registers for all targets.
       Additionally, high value prevents problem with x86_modes_tieable_p(),
       where integer modes in MMX/SSE registers are not tieable
       because of missing QImode and HImode moves to, from or between
       MMX/SSE registers.  */
    return MAX (8, MMX_CLASS_P (class1) || MMX_CLASS_P (class2)
                ? ix86_cost->mmxsse_to_integer : ix86_cost->ssemmx_to_integer);

Since inline_secondary_memory_needed has

  /* ??? This is a lie.  We do have moves between mmx/general, and for
     mmx/sse2.  But by saying we need secondary memory we discourage the
     register allocator from using the mmx registers unless needed.  */
  if (MMX_CLASS_P (class1) != MMX_CLASS_P (class2))
    return true; 

MMX_CLASS_P (class1) != MMX_CLASS_P (class2) is always false.  Also

struct processor_costs has:

  const int mmxsse_to_integer;  /* cost of moving mmxsse register to
                                   integer.  */
  const int ssemmx_to_integer;  /* cost of moving integer to mmxsse register.
*/

the mmxsse_to_integer field is never used.

Reply via email to