public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RS6000] Fix <bd>_<mode> and <bd>tf_<mode> splitters
@ 2019-02-16 12:10 Alan Modra
  2019-02-16 17:15 ` Segher Boessenkool
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2019-02-16 12:10 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

This patch fixes a bug that can result in "insn does not satisfy its
constraints" if these splitters fire due to not getting ctr for the
jump insn.  Since the jump insn can have any of r,m,d,wi,c,l as the
decremented count output, it's not sufficient to check for
gpc_reg_operand (which matches VSX regs for example).  Seen after
correcting register_move_cost when the cost of gpr <-> vsx is much
lower.  Since this is a prerequisite to fixing PR89271, I'm mentioning
that PR in the ChangeLog.

The <bd>tf_<mode> split had a further bug in that it wouldn't match
if the count output was m,d,wi, or l.

Bootstrapped etc. powerpc64le-linux.  OK?

	PR target/89271
	* config/rs6000/rs6000.md (<bd>_<mode> split): Check for an int
	output reg on add insn.
	(<bd>tf_<mode> split): Likewise.  Match predicates with insn.

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 9dd222dc5d7..51b6b7a9660 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -12525,7 +12525,7 @@ (define_split
 				const0_rtx);
   emit_insn (gen_rtx_SET (operands[3],
 			  gen_rtx_COMPARE (CCmode, operands[1], const1_rtx)));
-  if (gpc_reg_operand (operands[0], <MODE>mode))
+  if (int_reg_operand (operands[0], <MODE>mode))
     emit_insn (gen_add<mode>3 (operands[0], operands[1], constm1_rtx));
   else
     {
@@ -12603,7 +12603,7 @@ (define_split
 		       (const_int 0)]))
 	  (match_operand 4)
 	  (match_operand 5)))
-   (set (match_operand:P 6 "int_reg_operand")
+   (set (match_operand:P 6 "nonimmediate_operand")
 	(plus:P (match_dup 0)
 		(const_int -1)))
    (clobber (match_scratch:P 7))
@@ -12636,7 +12636,7 @@ (define_split
   else
      emit_insn (gen_cceq_ior_compare_complement (operands[9], andexpr, ctrcmpcc,
 						 operands[8], cccmp, ccin));
-  if (gpc_reg_operand (operands[0], <MODE>mode))
+  if (int_reg_operand (ctrout, <MODE>mode))
      emit_insn (gen_add<mode>3 (ctrout, ctr, constm1_rtx));
   else
     {

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RS6000] Fix <bd>_<mode> and <bd>tf_<mode> splitters
  2019-02-16 12:10 [RS6000] Fix <bd>_<mode> and <bd>tf_<mode> splitters Alan Modra
@ 2019-02-16 17:15 ` Segher Boessenkool
  2019-02-17  3:14   ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Segher Boessenkool @ 2019-02-16 17:15 UTC (permalink / raw)
  To: Alan Modra; +Cc: gcc-patches

Hi Alan,

On Sat, Feb 16, 2019 at 10:40:24PM +1030, Alan Modra wrote:
> This patch fixes a bug that can result in "insn does not satisfy its
> constraints" if these splitters fire due to not getting ctr for the
> jump insn.  Since the jump insn can have any of r,m,d,wi,c,l as the
> decremented count output, it's not sufficient to check for
> gpc_reg_operand (which matches VSX regs for example).  Seen after
> correcting register_move_cost when the cost of gpr <-> vsx is much
> lower.  Since this is a prerequisite to fixing PR89271, I'm mentioning
> that PR in the ChangeLog.
> 
> The <bd>tf_<mode> split had a further bug in that it wouldn't match
> if the count output was m,d,wi, or l.
> 
> Bootstrapped etc. powerpc64le-linux.  OK?

Okay, thanks!  For trunk as well as backports.


Segher

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RS6000] Fix <bd>_<mode> and <bd>tf_<mode> splitters
  2019-02-16 17:15 ` Segher Boessenkool
@ 2019-02-17  3:14   ` Alan Modra
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2019-02-17  3:14 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches

On Sat, Feb 16, 2019 at 11:14:11AM -0600, Segher Boessenkool wrote:
> Okay, thanks!  For trunk as well as backports.

Applied to trunk.  gcc-8 is frozen until after the 8.3 release so I'll
have to wait a while for backports.  There is some chance we'll hit
ICEs on 8.3 like we occasionally did when reload used to put a loop
counter in an fpr..

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-17  3:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-16 12:10 [RS6000] Fix <bd>_<mode> and <bd>tf_<mode> splitters Alan Modra
2019-02-16 17:15 ` Segher Boessenkool
2019-02-17  3:14   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).