public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Paulo Matos" <pmatos@broadcom.com>
To: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Dependency confusion in sched-deps
Date: Thu, 07 Nov 2013 12:48:00 -0000	[thread overview]
Message-ID: <19EB96622A777C4AB91610E763265F463A3EB0@SJEXCHMB14.corp.ad.broadcom.com> (raw)

Hello,

I am slightly unsure if the confusion is in the dependencies or it's my confusion.

I have tracked this strange behaviour which only occurs when we need to flush pending instructions due to the pending list becoming too large (gcc 4.8, haven't tried with trunk).

I have two stores: 
85: st zr, [r12] # zr is the zero register
90: st zr, [r18]

While analysing dependencies for `st zr, [r12]`, we notice that pending list is too large in sched_analyze_1 and call flush_pending_lists (deps, insn, false, true).

This in turn causes the last_pending_memory_flush to be set to:
(insn_list:REG_DEP_TRUE 85 (nil))

When insn 90 is analyzed next, it skips the flushing bit since the pending lists had just been flushed and enters the else bit where it does:
	  add_dependence_list (insn, deps->last_pending_memory_flush, 1,
			       REG_DEP_ANTI, true);

This adds the dependency: 90 has an anti-dependency to 85.
I think this should be a true dependency (write after write). It even says so in the list of last_pending_memory_flush, however add_dependence_list function ignored this and uses the dep_type passed: REG_DEP_ANTI.

Is anti the correct dependence? Why?

-- 
Paulo Matos



             reply	other threads:[~2013-11-07 12:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 12:48 Paulo Matos [this message]
2013-12-05  0:39 ` Maxim Kuvyrkov
2013-12-05 15:25   ` Michael Matz
2013-12-05 23:08     ` Maxim Kuvyrkov
2013-12-05 19:44   ` shmeel gutl
2013-12-05 23:34     ` Maxim Kuvyrkov
2013-12-06  8:44       ` shmeel gutl
2013-12-10 21:55         ` Maxim Kuvyrkov

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=19EB96622A777C4AB91610E763265F463A3EB0@SJEXCHMB14.corp.ad.broadcom.com \
    --to=pmatos@broadcom.com \
    --cc=gcc@gcc.gnu.org \
    /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).