public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrey Belevantsev <abel@ispras.ru>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: "Vladimir N. Makarov" <vmakarov@redhat.com>
Subject: [PATCH] PR 54472
Date: Tue, 30 Oct 2012 08:27:00 -0000	[thread overview]
Message-ID: <508F8B4B.2000103@ispras.ru> (raw)

Hello,

This PR is due to the selective scheduling missing the dependencies with 
implicit_sets.  From the sched-deps.c code it looks like implicit sets 
generate anti dependencies with either sets, uses or clobbers, so that's 
that I've done with the below patch.  Vlad, as it looks you've added 
implicit sets, does the above conclusion look correct?  I will commit the 
patch then after bootstrapping and testing will complete.

Yours,
Andrey

2012-10-30  Andrey Belevantsev  <abel@ispras.ru>

	PR rtl-optimization/54472

	* sel-sched-ir.c (has_dependence_note_reg_set): Handle
	implicit sets.
	(has_dependence_note_reg_clobber,
	has_dependence_note_reg_use): Likewise.

2012-10-30  Andrey Belevantsev  <abel@ispras.ru>

	PR rtl-optimization/54472
	
	* gcc.dg/pr54472.c: New test.

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 2a7a170..220568a 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -3185,7 +3185,7 @@ has_dependence_note_reg_set (int regno)
           || reg_last->clobbers != NULL)
         *dsp = (*dsp & ~SPECULATIVE) | DEP_OUTPUT;

-      if (reg_last->uses)
+      if (reg_last->uses || reg_last->implicit_sets)
         *dsp = (*dsp & ~SPECULATIVE) | DEP_ANTI;
      }
  }
@@ -3205,7 +3205,7 @@ has_dependence_note_reg_clobber (int regno)
        if (reg_last->sets)
         *dsp = (*dsp & ~SPECULATIVE) | DEP_OUTPUT;

-      if (reg_last->uses)
+      if (reg_last->uses || reg_last->implicit_sets)
         *dsp = (*dsp & ~SPECULATIVE) | DEP_ANTI;
      }
  }
@@ -3225,7 +3225,7 @@ has_dependence_note_reg_use (int regno)
        if (reg_last->sets)
         *dsp = (*dsp & ~SPECULATIVE) | DEP_TRUE;

-      if (reg_last->clobbers)
+      if (reg_last->clobbers || reg_last->implicit_sets)
         *dsp = (*dsp & ~SPECULATIVE) | DEP_ANTI;

        /* Merge BE_IN_SPEC bits into *DSP when the dependency producer
diff --git a/gcc/testsuite/gcc.dg/pr54472.c b/gcc/testsuite/gcc.dg/pr54472.c
new file mode 100644
index 0000000..9395203
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr54472.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O -fschedule-insns -fselective-scheduling" } */
+
+int main ()
+{
+  int a[3][3][3];
+  __builtin_memset (a, 0, sizeof a);
+  return 0;
+}

             reply	other threads:[~2012-10-30  8:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30  8:27 Andrey Belevantsev [this message]
2012-11-09 12:32 ` Andrey Belevantsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=508F8B4B.2000103@ispras.ru \
    --to=abel@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=vmakarov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).