diff mbox series

s390: Align *cjump_64 and *icjump_64

Message ID 20240711142919.1328689-1-stefansf@gcc.gnu.org
State New
Headers show
Series s390: Align *cjump_64 and *icjump_64 | expand

Commit Message

Stefan Schulze Frielinghaus July 11, 2024, 2:29 p.m. UTC
During machine reorg we optimize backward jumps and transform insns as
e.g.

(jump_insn 118 117 119 (set (pc)
        (if_then_else (ne (reg:CCRAW 33 %cc)
                (const_int 8 [0x8]))
            (label_ref 134)
            (pc))) "dec_math_1.f90":204:8 discrim 1 2161 {*cjump_64}
     (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
        (int_list:REG_BR_PROB 719407028 (nil)))
 -> 134)

into

(jump_insn 118 117 432 (set (pc)
        (if_then_else (ne (reg:CCRAW 33 %cc)
                (const_int 8 [0x8]))
            (pc)
            (label_ref 433))) "dec_math_1.f90":204:8 discrim 1 -1
     (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
        (int_list:REG_BR_PROB 719407028 (nil)))
 -> 433)

The latter is not recognized anymore since *icjump_64 only matches
CC_REGNUM against zero.  Fixed by aligning *cjump_64 and *icjump_64.

gcc/ChangeLog:

	* config/s390/s390.md (*icjump_64): Allow raw CC comparisons,
	i.e., any constant integer between 0 and 15 for CC comparisons.
---
 Bootstrap and regtest or still running.  Assuming no regressions, ok
 for {mainline,11,12,13,14}?  Would be great to see this in 14.2 RC :)

 gcc/config/s390/s390.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefan Schulze Frielinghaus July 11, 2024, 3:09 p.m. UTC | #1
On Thu, Jul 11, 2024 at 04:29:19PM +0200, Stefan Schulze Frielinghaus wrote:
> During machine reorg we optimize backward jumps and transform insns as
> e.g.
> 
> (jump_insn 118 117 119 (set (pc)
>         (if_then_else (ne (reg:CCRAW 33 %cc)
>                 (const_int 8 [0x8]))
>             (label_ref 134)
>             (pc))) "dec_math_1.f90":204:8 discrim 1 2161 {*cjump_64}
>      (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
>         (int_list:REG_BR_PROB 719407028 (nil)))
>  -> 134)
> 
> into
> 
> (jump_insn 118 117 432 (set (pc)
>         (if_then_else (ne (reg:CCRAW 33 %cc)
>                 (const_int 8 [0x8]))
>             (pc)
>             (label_ref 433))) "dec_math_1.f90":204:8 discrim 1 -1
>      (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
>         (int_list:REG_BR_PROB 719407028 (nil)))
>  -> 433)
> 
> The latter is not recognized anymore since *icjump_64 only matches
> CC_REGNUM against zero.  Fixed by aligning *cjump_64 and *icjump_64.
> 
> gcc/ChangeLog:
> 
> 	* config/s390/s390.md (*icjump_64): Allow raw CC comparisons,
> 	i.e., any constant integer between 0 and 15 for CC comparisons.
> ---
>  Bootstrap and regtest or still running.  Assuming no regressions, ok
>  for {mainline,11,12,13,14}?  Would be great to see this in 14.2 RC :)

I didn't have the schedule for 11.5 RC in mind which is tomorrow and the
release a week afterwards.  I hope this is still appropriate for 11.5?

Cheers,
Stefan

> 
>  gcc/config/s390/s390.md | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
> index f5d7003dfad..d3931b09417 100644
> --- a/gcc/config/s390/s390.md
> +++ b/gcc/config/s390/s390.md
> @@ -9556,7 +9556,8 @@
>  (define_insn "*icjump_64"
>    [(set (pc)
>          (if_then_else
> -          (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)])
> +          (match_operator 1 "s390_comparison" [(reg CC_REGNUM)
> +					       (match_operand 2 "const_int_operand" "")])
>            (pc)
>            (label_ref (match_operand 0 "" ""))))]
>    ""
> -- 
> 2.45.2
>
Jakub Jelinek July 11, 2024, 3:14 p.m. UTC | #2
On Thu, Jul 11, 2024 at 05:09:41PM +0200, Stefan Schulze Frielinghaus wrote:
> I didn't have the schedule for 11.5 RC in mind which is tomorrow and the
> release a week afterwards.  I hope this is still appropriate for 11.5?

From my side, if Andreas or somebody else approves it, it is tested on 11
branch and committed by tomorrow, it can be added.
But I'd like to know what patches I should wait for tomorrow and approximate
ETA (and ideally before end of working day in Europe).  Once rc1 is done, only
severe blockers will be possible.

	Jakub
Andreas Krebbel July 11, 2024, 4:31 p.m. UTC | #3
On 7/11/24 16:29, Stefan Schulze Frielinghaus wrote:

> During machine reorg we optimize backward jumps and transform insns as
> e.g.
>
> (jump_insn 118 117 119 (set (pc)
>          (if_then_else (ne (reg:CCRAW 33 %cc)
>                  (const_int 8 [0x8]))
>              (label_ref 134)
>              (pc))) "dec_math_1.f90":204:8 discrim 1 2161 {*cjump_64}
>       (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
>          (int_list:REG_BR_PROB 719407028 (nil)))
>   -> 134)
>
> into
>
> (jump_insn 118 117 432 (set (pc)
>          (if_then_else (ne (reg:CCRAW 33 %cc)
>                  (const_int 8 [0x8]))
>              (pc)
>              (label_ref 433))) "dec_math_1.f90":204:8 discrim 1 -1
>       (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
>          (int_list:REG_BR_PROB 719407028 (nil)))
>   -> 433)
>
> The latter is not recognized anymore since *icjump_64 only matches
> CC_REGNUM against zero.  Fixed by aligning *cjump_64 and *icjump_64.
>
> gcc/ChangeLog:
>
> 	* config/s390/s390.md (*icjump_64): Allow raw CC comparisons,
> 	i.e., any constant integer between 0 and 15 for CC comparisons.

Ok. Thanks!


Andreas
Stefan Schulze Frielinghaus July 11, 2024, 5:32 p.m. UTC | #4
On Thu, Jul 11, 2024 at 05:14:58PM +0200, Jakub Jelinek wrote:
> On Thu, Jul 11, 2024 at 05:09:41PM +0200, Stefan Schulze Frielinghaus wrote:
> > I didn't have the schedule for 11.5 RC in mind which is tomorrow and the
> > release a week afterwards.  I hope this is still appropriate for 11.5?
> 
> From my side, if Andreas or somebody else approves it, it is tested on 11
> branch and committed by tomorrow, it can be added.
> But I'd like to know what patches I should wait for tomorrow and approximate
> ETA (and ideally before end of working day in Europe).  Once rc1 is done, only
> severe blockers will be possible.

The tester is running over night and will finish around 7 AM CEST.  I
will let you know once it has finished.  If anything goes wrong we can
skip this patch of course.

Cheers,
Stefan
Stefan Schulze Frielinghaus July 12, 2024, 5:09 a.m. UTC | #5
On Thu, Jul 11, 2024 at 07:32:17PM +0200, Stefan Schulze Frielinghaus wrote:
> On Thu, Jul 11, 2024 at 05:14:58PM +0200, Jakub Jelinek wrote:
> > On Thu, Jul 11, 2024 at 05:09:41PM +0200, Stefan Schulze Frielinghaus wrote:
> > > I didn't have the schedule for 11.5 RC in mind which is tomorrow and the
> > > release a week afterwards.  I hope this is still appropriate for 11.5?
> > 
> > From my side, if Andreas or somebody else approves it, it is tested on 11
> > branch and committed by tomorrow, it can be added.
> > But I'd like to know what patches I should wait for tomorrow and approximate
> > ETA (and ideally before end of working day in Europe).  Once rc1 is done, only
> > severe blockers will be possible.
> 
> The tester is running over night and will finish around 7 AM CEST.  I
> will let you know once it has finished.  If anything goes wrong we can
> skip this patch of course.

The tester was extremely slow this time and still didn't finish.  I
don't wanna rush it risking to introduce late time problems for the
11.5 release.  Since I'm testing for three different architectures and
the first one hasn't finished, let's drop this patch for 11.5.

Sorry for the noise,
Stefan
Jakub Jelinek July 12, 2024, 9:40 a.m. UTC | #6
On Fri, Jul 12, 2024 at 07:09:37AM +0200, Stefan Schulze Frielinghaus wrote:
> On Thu, Jul 11, 2024 at 07:32:17PM +0200, Stefan Schulze Frielinghaus wrote:
> > On Thu, Jul 11, 2024 at 05:14:58PM +0200, Jakub Jelinek wrote:
> > > On Thu, Jul 11, 2024 at 05:09:41PM +0200, Stefan Schulze Frielinghaus wrote:
> > > > I didn't have the schedule for 11.5 RC in mind which is tomorrow and the
> > > > release a week afterwards.  I hope this is still appropriate for 11.5?
> > > 
> > > From my side, if Andreas or somebody else approves it, it is tested on 11
> > > branch and committed by tomorrow, it can be added.
> > > But I'd like to know what patches I should wait for tomorrow and approximate
> > > ETA (and ideally before end of working day in Europe).  Once rc1 is done, only
> > > severe blockers will be possible.
> > 
> > The tester is running over night and will finish around 7 AM CEST.  I
> > will let you know once it has finished.  If anything goes wrong we can
> > skip this patch of course.
> 
> The tester was extremely slow this time and still didn't finish.  I
> don't wanna rush it risking to introduce late time problems for the
> 11.5 release.  Since I'm testing for three different architectures and
> the first one hasn't finished, let's drop this patch for 11.5.

We haven't started the RC yet, so if it finished testing by now, feel free
to commit within the next 15 minutes or so.

	Jakub
diff mbox series

Patch

diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index f5d7003dfad..d3931b09417 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -9556,7 +9556,8 @@ 
 (define_insn "*icjump_64"
   [(set (pc)
         (if_then_else
-          (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)])
+          (match_operator 1 "s390_comparison" [(reg CC_REGNUM)
+					       (match_operand 2 "const_int_operand" "")])
           (pc)
           (label_ref (match_operand 0 "" ""))))]
   ""