On 25.10.18 16:00, Ilya Leoshkevich wrote:
> Bootstrapped and regtested on s390x-redhat-linux.
> 
> Consider the following RTL:
> 
> (insn (set (mem/f/c:DI (reg/f:DI 60))
>            (const:DI (plus:DI (symbol_ref:DI ("*.LANCHOR0"))
>                               (const_int 8)))))
> 
> generated by cse2 pass.  It is matched to movdi_64, resulting in
> the following inefficient code:
> 
>       larl    %r5,.L6                 # Load literal pool@
>       lg      %r1,.L7-.L6(%r5)        # Load .LANCHOR0+8
>       stgrl   %r1,.LANCHOR0
>       br      %r14
> 
> Matching it to movdi_larl improves the code, eliminating one
> instruction and the literal pool entry:
> 
>       larl    %r1,.LANCHOR0+8
>       stgrl   %r1,.LANCHOR0
>       br      %r14
> 
> Taking it one step further, there is no reason to keep movdi_64 and
> movdi_larl separate, since this could potentially improve code in other
> ways by giving lra one more alternative to choose from.
> 
> gcc/ChangeLog:
> 
> 2018-10-22  Ilya Leoshkevich  <i...@linux.ibm.com>
> 
>       * config/s390/constraints.md (ZL): New constraint.
>       * config/s390/s390.c (legitimate_pic_operand_p): Accept LARL
>       operands.
>       * config/s390/s390.md (movdi_larl): Remove.
>       (movdi_64): Add the LARL alternative.
> 
> gcc/testsuite/ChangeLog:
> 
> 2018-10-25  Ilya Leoshkevich  <i...@linux.ibm.com>
> 
>       * gcc.target/s390/global-array-almost-huge-element.c: New test.
>       * gcc.target/s390/global-array-almost-negative-huge-element.c: New test.
>       * gcc.target/s390/global-array-element-pic.c: New test.
>       * gcc.target/s390/global-array-even-element.c: New test.
>       * gcc.target/s390/global-array-huge-element.c: New test.
>       * gcc.target/s390/global-array-negative-huge-element.c: New test.
>       * gcc.target/s390/global-array-odd-element.c: New test.

Ok. Thanks!

Andreas

Reply via email to