[patch] Fixing ppc64 test failure after patch dealing with scratches in IRA

Vladimir Makarov vmakarov@redhat.com
Mon Nov 2 16:18:00 GMT 2020


On 2020-11-02 6:43 a.m., Segher Boessenkool wrote:
> Hi!
>
> On Sun, Nov 01, 2020 at 06:32:02PM -0500, Vladimir Makarov wrote:
>> On 2020-10-30 7:36 p.m., Segher Boessenkool wrote:
>>> Thanks for the patch!  But it has a problem:
>>>
>>>> diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
>>>> index 67e4f2fd037..78de85ccbbb 100644
>>>> --- a/gcc/config/rs6000/vsx.md
>>>> +++ b/gcc/config/rs6000/vsx.md
>>>> @@ -3717,7 +3717,7 @@
>>>>   	(vec_select:<VS_scalar>
>>>>   	 (match_operand:VSX_EXTRACT_I 1 "gpc_reg_operand" "<VSX_EX>,v")
>>>>   	 (parallel [(match_operand:QI 2 "const_int_operand" "n,n")])))
>>>> -   (clobber (match_scratch:<VS_scalar> 3 "=<VSX_EX>,&r"))
>>>> +   (clobber (match_scratch:<VS_scalar> 3 "=*<VSX_EX>,&*r"))
>>>>      (clobber (match_scratch:SI 4 "=X,&r"))]
>>>>     "VECTOR_MEM_VSX_P (<MODE>mode) && TARGET_VEXTRACTUB"
>>>>     "#"
>>> You add * to both alternatives here?  I would expect adding it to only
>>> the second alternative, does it work better with both?
>> No.  It works the same.  When the both alternatives use the hint, the
>> scratch pseudo got the class ALL_REGS.  When only the 2nd use the hint,
>> the class is VSX_REGS.  As I understand now the preferable alternative
>> is the 1st one (with <VSX> for the scratch).  In this case using the
>> hint only for the 2nd alternative has more sense.
>>> That also avoids a different problem: *<VSX_EX> won't work as expected.
>>> '*' in IRA skips one constraint character, but <VSX_EX> can be "wa", a
>>> two-letter constraint (and we do have an "a" constraint as well,
>>> something wholly different: "wa" means a VSX register, while "a" is an
>>> indexed address).
>>>
>>>                  case '*':
>>>                    /* Ignore the next letter for this pass.  */
>>>                    c = *++p;
>>>                    break;
>>>
>>>
>> I see.  Thanks for pointing this out. Definitely it is better to use the
>> hint only for the second alternative ("&*r") then.  Is this solution ok
>> for you?
> Yes, certainly.  And thanks!

I've just committed the following patch

commit 1c689b827c6a0a5e164f22865696a94e6d7ec308 (HEAD -> master, 
origin/master, origin/HEAD)
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Mon Nov 2 11:03:54 2020 -0500

     Add hint * too 2nd alternative of the 1st scratch in 
*vsx_extract_<mode>_store_p9.

     gcc/ChangeLog:

             * config/rs6000/vsx.md (*vsx_extract_<mode>_store_p9): Add 
hint *
             to 2nd alternative of the 1st scratch.

diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 67e4f2fd037..947631d83ee 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -3717,7 +3717,7 @@
         (vec_select:<VS_scalar>
          (match_operand:VSX_EXTRACT_I 1 "gpc_reg_operand" "<VSX_EX>,v")
          (parallel [(match_operand:QI 2 "const_int_operand" "n,n")])))
-   (clobber (match_scratch:<VS_scalar> 3 "=<VSX_EX>,&r"))
+   (clobber (match_scratch:<VS_scalar> 3 "=<VSX_EX>,&*r"))
     (clobber (match_scratch:SI 4 "=X,&r"))]
    "VECTOR_MEM_VSX_P (<MODE>mode) && TARGET_VEXTRACTUB"
    "#"


> (Should "*" be changed so that it skips a whole constraint if it can,
> instead of only a single char always?)
>
>
Yes, it should be changed.  I believe this is a leftover from the time 
when all constraints were just one character.  All hints (modifiers) 
should work on constraint base not the character one.





More information about the Gcc-patches mailing list