public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* ptx preliminary rtl patches [1/4]
@ 2014-09-11 13:25 Bernd Schmidt
  2014-10-29 23:58 ` Bernd Schmidt
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bernd Schmidt @ 2014-09-11 13:25 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

The nvptx backend is somewhat unusual in that call insns set a pseudo. 
The combiner is surprised by this and allows combining them into other 
insns, which remain as INSN rather than CALL_INSN. Aborts ensue.

Bootstrapped and tested on x86_64-linux, together with the other 
patches.  Ok?


Bernd

[-- Attachment #2: ptx-rtl1.diff --]
[-- Type: text/x-patch, Size: 647 bytes --]

    	* combine.c (try_combine): Don't allow a call as one of the source
    	insns.

diff --git a/gcc/combine.c b/gcc/combine.c
index 0ec7f85..fe95b41 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2543,7 +2543,10 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
 
   /* Exit early if one of the insns involved can't be used for
      combinations.  */
-  if (cant_combine_insn_p (i3)
+  if (CALL_P (i2)
+      || (i1 && CALL_P (i1))
+      || (i0 && CALL_P (i0))
+      || cant_combine_insn_p (i3)
       || cant_combine_insn_p (i2)
       || (i1 && cant_combine_insn_p (i1))
       || (i0 && cant_combine_insn_p (i0))

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

* Re: ptx preliminary rtl patches [1/4]
  2014-09-11 13:25 ptx preliminary rtl patches [1/4] Bernd Schmidt
@ 2014-10-29 23:58 ` Bernd Schmidt
  2014-10-30  3:47 ` Jeff Law
  2014-10-30 18:38 ` Segher Boessenkool
  2 siblings, 0 replies; 6+ messages in thread
From: Bernd Schmidt @ 2014-10-29 23:58 UTC (permalink / raw)
  To: GCC Patches

On 09/11/2014 03:24 PM, Bernd Schmidt wrote:
> The nvptx backend is somewhat unusual in that call insns set a pseudo.
> The combiner is surprised by this and allows combining them into other
> insns, which remain as INSN rather than CALL_INSN. Aborts ensue.
>
> Bootstrapped and tested on x86_64-linux, together with the other
> patches.  Ok?

Ping.


Bernd


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

* Re: ptx preliminary rtl patches [1/4]
  2014-09-11 13:25 ptx preliminary rtl patches [1/4] Bernd Schmidt
  2014-10-29 23:58 ` Bernd Schmidt
@ 2014-10-30  3:47 ` Jeff Law
  2014-10-30 18:38 ` Segher Boessenkool
  2 siblings, 0 replies; 6+ messages in thread
From: Jeff Law @ 2014-10-30  3:47 UTC (permalink / raw)
  To: Bernd Schmidt, GCC Patches

On 09/11/14 07:24, Bernd Schmidt wrote:
> The nvptx backend is somewhat unusual in that call insns set a pseudo.
> The combiner is surprised by this and allows combining them into other
> insns, which remain as INSN rather than CALL_INSN. Aborts ensue.
>
> Bootstrapped and tested on x86_64-linux, together with the other
> patches.  Ok?
OK.
jeff

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

* Re: ptx preliminary rtl patches [1/4]
  2014-09-11 13:25 ptx preliminary rtl patches [1/4] Bernd Schmidt
  2014-10-29 23:58 ` Bernd Schmidt
  2014-10-30  3:47 ` Jeff Law
@ 2014-10-30 18:38 ` Segher Boessenkool
  2014-10-30 23:38   ` Jeff Law
  2014-10-31 17:27   ` Bernd Schmidt
  2 siblings, 2 replies; 6+ messages in thread
From: Segher Boessenkool @ 2014-10-30 18:38 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: GCC Patches

On Thu, Sep 11, 2014 at 03:24:54PM +0200, Bernd Schmidt wrote:
> The nvptx backend is somewhat unusual in that call insns set a pseudo. 
> The combiner is surprised by this and allows combining them into other 
> insns, which remain as INSN rather than CALL_INSN. Aborts ensue.

distribute_notes has code for when I2 is a CALL.  This suggests that
on some other targets there can be useful combinations made, so it
isn't in that case terribly nice to disable all combinations with CALLs
as I0 or I1 or I2.

Or it's dead code :-)


Segher

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

* Re: ptx preliminary rtl patches [1/4]
  2014-10-30 18:38 ` Segher Boessenkool
@ 2014-10-30 23:38   ` Jeff Law
  2014-10-31 17:27   ` Bernd Schmidt
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Law @ 2014-10-30 23:38 UTC (permalink / raw)
  To: Segher Boessenkool, Bernd Schmidt; +Cc: GCC Patches

On 10/30/14 11:36, Segher Boessenkool wrote:
> On Thu, Sep 11, 2014 at 03:24:54PM +0200, Bernd Schmidt wrote:
>> The nvptx backend is somewhat unusual in that call insns set a pseudo.
>> The combiner is surprised by this and allows combining them into other
>> insns, which remain as INSN rather than CALL_INSN. Aborts ensue.
>
> distribute_notes has code for when I2 is a CALL.  This suggests that
> on some other targets there can be useful combinations made, so it
> isn't in that case terribly nice to disable all combinations with CALLs
> as I0 or I1 or I2.
>
> Or it's dead code :-)
Most likely it's dead code.

jeff

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

* Re: ptx preliminary rtl patches [1/4]
  2014-10-30 18:38 ` Segher Boessenkool
  2014-10-30 23:38   ` Jeff Law
@ 2014-10-31 17:27   ` Bernd Schmidt
  1 sibling, 0 replies; 6+ messages in thread
From: Bernd Schmidt @ 2014-10-31 17:27 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches

On 10/30/2014 06:36 PM, Segher Boessenkool wrote:
> On Thu, Sep 11, 2014 at 03:24:54PM +0200, Bernd Schmidt wrote:
>> The nvptx backend is somewhat unusual in that call insns set a pseudo.
>> The combiner is surprised by this and allows combining them into other
>> insns, which remain as INSN rather than CALL_INSN. Aborts ensue.
>
> distribute_notes has code for when I2 is a CALL.  This suggests that
> on some other targets there can be useful combinations made, so it
> isn't in that case terribly nice to disable all combinations with CALLs
> as I0 or I1 or I2.
>
> Or it's dead code :-)

I suspect the latter. As far as I can tell the patch does not change 
code generation on x86_64 at least (on a large set of input files 
including gcc, spec2k and linux-kernel).


Bernd


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

end of thread, other threads:[~2014-10-31 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 13:25 ptx preliminary rtl patches [1/4] Bernd Schmidt
2014-10-29 23:58 ` Bernd Schmidt
2014-10-30  3:47 ` Jeff Law
2014-10-30 18:38 ` Segher Boessenkool
2014-10-30 23:38   ` Jeff Law
2014-10-31 17:27   ` Bernd Schmidt

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).