This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
haifa-scheduler marks instructions having TRUE dependencies as an ANTI dependencies.
- From: "Viktor Pobedin" <viktor dot pobedin at gmail dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Thu, 4 Jul 2013 17:25:59 +0300
- Subject: haifa-scheduler marks instructions having TRUE dependencies as an ANTI dependencies.
Hi all,
It seems that sometimes haifa-scheduler assigns ANTI dependency for the
instructions having TRUE dependency.
I observed it happening in case of basic block as following:
<32 memory load/store rtx>
rtx_1: store to memory
rtx_2: load from memory
I1 and i2 will have ANTI dependency instead of TRUE dependency.
Once the sizes of pending_read_insns and pending_write_insns is bigger than
MAX_PENDING_LIST_LENGTH (32) the sched_analyze_1 does flush_pending_lists
thus putting current insn (rtx_1 in this example) to the
last_pending_memory_flush list. During the analysis of the next rtx (rtx_2
in the example) sched_analyze_2 marks rtx_1 and rtx_2 as having ANTI
dependence. This is done in sched-deps.c:2652 by the following code:
for (u = deps->last_pending_memory_flush; u; u = XEXP
(u, 1))
add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
I have few questions with this regard:
1. Is my understanding correct?
2. If it is what is the reason for this behavior?
3. What should I do in the cost_adjust hook if I want to distinguish
between two cases (TRUE and ANTI dependency). In my target the cost for
anti-dependency is 0, and cost for the true dependency 1 or bigger.
BR, Viktor.