On Wed, Apr 30, 2025 at 11:43 PM H.J. Lu <hjl.to...@gmail.com> wrote:
>
> On Wed, Apr 30, 2025 at 8:12 PM Uros Bizjak <ubiz...@gmail.com> wrote:
> >
> > On Tue, Apr 29, 2025 at 11:40 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > >
> > > SSE_FIRST_REG was added to CLASS_LIKELY_SPILLED_P, which became
> > > TARGET_CLASS_LIKELY_SPILLED_P, for
> > >
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40470
> > >
> > > Since RA has been improved and xmm0 is a commonly used register, remove
> > > SSE_FIRST_REG from ix86_class_likely_spilled_p to improve xmm0 codegen:
> >
> > While the AVX version of pblendvb doesn't use XMM0 as an architectural
> > register, there are still plenty of other cases, e.g. PCMPESTM and
> > PCMPISTRM, SHA and KEYLOCKER insns, so you are risking RA failures
> > with these insn if the life of XMM0 is extended.
>
> This is no different from
>
> void
> foo1 (double x)
> {
>   register double xmm1 __asm ("xmm1") = x;
>   asm volatile ("# %0" : "+v" (xmm1));
> }
>
> We don't add XMM1 to ix86_class_likely_spilled_p.

I don't see the relation between the above example and

xor %xmm0,%xmm0
...
movaps val,%xmm0  <- needed for pcmpistrm, fails reload due to already
live %xmm0
pcmpistrm
...
movaps %xmm0, %xmm2

> > OTOH, the (unrelated?) ternlog change changes the expander, where the
> > expander does subreg tricks on memory operand, which doesn' look
> > correct to me. adjust_address should be used instead.
> >
> >
>
> Should I drop the ternlog change and submit a different patch?

No, please submit a ternlog change that will avoid subreg with memory.

Uros.

Reply via email to