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

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #6 from Hongtao.liu <crazylht at gmail dot com> ---


(In reply to Vladimir Makarov from comment #4)
> (In reply to Jakub Jelinek from comment #3)
> > The IRA dump says:
> >   a2(r189,l0) costs: AREG:2000,2000 DREG:2000,2000 CREG:26000,-1000
> > BREG:2000,2000 SIREG:2000,2000 DIREG:2000,2000 AD_REGS:2000,2000
> > CLOBBERED_REGS
> > :2000,2000 Q_REGS:2000,2000 TLS_GOTBASE_REGS:2000,2000
> > GENERAL_REGS:2000,2000 SSE_FIRST_REG:12000,12000 NO_REX_SSE_REGS:12000,12000
> > SSE_REGS:12000,
> > 12000 ALL_SSE_REGS:12000,12000 MMX_REGS:26000,26000 INT_SSE_REGS:26000,26000
> > ALL_REGS:424000,424000 MEM:12000,12000
> > so the INT_SSE_REGS cost of 26000 seems might higher than GENERAL_REGS cost.
> 
> It does not matter what class IRA gives the address reg. LRA should fix this
> anyway.  For usual memory the correct address reg class is checked by
> legitimate_address_p hook.
> 
> I guess in this case it is a special memory and its constraint does not
> check address reg class at all.  I believe the bug should be fixed on
> machine-dependent side of GCC (in constraints and predicates).

In 
(define_predicate "bcst_mem_operand"
  (and (match_code "vec_duplicate")
       (and (match_test "TARGET_AVX512F")
            (ior (match_test "TARGET_AVX512VL")
                 (match_test "GET_MODE_SIZE (GET_MODE (op)) == 64")))
       (match_test "VALID_BCST_MODE_P (GET_MODE_INNER (GET_MODE (op)))")
       (match_test "memory_operand (XEXP (op, 0), GET_MODE (XEXP (op, 0)))")))

Shouldn't memory_operand (XEXP (op, 0), GET_MODE (XEXP (op, 0))) imply
legitimate_address_p?

Reply via email to