On Tue, Nov 7, 2017 at 11:10 AM, Jakub Jelinek <ja...@redhat.com> wrote:

>> > Isn't it sufficient that moves disparage slightly the k alternatives?
>> > Or are you worried about the case where the pseudo would need to be spilled
>> > and LRA would choose to reload it into a %kN register?
>>
>> The later... Perhaps it is possible to prevent unwanted reloads with
>> ?k (or even ??k, we already have ?m<r>, IDK). I have used *k in
>> zero-extend patterns to prevent unwanted reloads, which is perhaps too
>> strong, but we have ree pass that eliminates unwanted moves in this
>> case (*k in move patterns is handled by other regmove elimination
>> passes).
>
> ?k gives the same IRA decisions as *k, in both cases it considers
> GENERAL_REGS as expensive as MASK_EVEX_REGS and picks up GENERAL_REGS
> rather than MASK_EVEX_REGS for the pseudo, which results in
> kmovb %k1, %eax; test.

Can we use some of the new RA modifiers here?

--cut here--
'?'
     Disparage slightly the alternative that the '?' appears in, as a
     choice when no alternative applies exactly.  The compiler regards
     this alternative as one unit more costly for each '?' that appears
     in it.

'!'
     Disparage severely the alternative that the '!' appears in.  This
     alternative can still be used if it fits without reloading, but if
     reloading is needed, some other alternative will be used.

'^'
     This constraint is analogous to '?' but it disparages slightly the
     alternative only if the operand with the '^' needs a reload.

'$'
     This constraint is analogous to '!' but it disparages severely the
     alternative only if the operand with the '$' needs a reload.
--cut here--

'$' looks promising to prevent unwanted reloads to kN register.

Uros.

Reply via email to