public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Dependency confusion in sched-deps
@ 2013-11-07 12:48 Paulo Matos
  2013-12-05  0:39 ` Maxim Kuvyrkov
  0 siblings, 1 reply; 8+ messages in thread
From: Paulo Matos @ 2013-11-07 12:48 UTC (permalink / raw)
  To: gcc

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



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

end of thread, other threads:[~2013-12-10 21:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-07 12:48 Dependency confusion in sched-deps Paulo Matos
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

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