This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] haifa-sched: SCHED_GROUP_P ignored for queued insn
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: Andreas Krebbel <krebbel1 at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 09 Feb 2005 09:58:13 -0500
- Subject: Re: [PATCH] haifa-sched: SCHED_GROUP_P ignored for queued insn
- References: <20050208145428.GA3685@de.ibm.com>
Andreas Krebbel wrote:
Hi,Yes, that is a real problem of tests for insn scheduler. Even if they
are extracted and made small they become obsolete pretty soon because
generated code changes every day.
(sorry for the last empty mail :(
a scheduler bug makes insns of different LIBCALL/RETVAL blocks to get
If a SCHED_GROUP_P insn gets queued due to a pipeline hazard, the scheduler
chooses an insn from the ready list without looking at the queued_list.
If an insn which belongs to a sched group is available either on the ready list
or on the queued list this insn has to be scheduled (according to the definition
of sched groups).
For insns queued due to data dependencies there is already a check
(haifa-sched.c:952) which advances the cycle count so that the queued
sched group insn comes to the ready list in the next turn and hence can
be choosen by choose_insn.
The attached patch implements the same check for the other call of queue_insn
This fixes a testcase on s390x compiled with -O2, -m31 and -march=z990. Unfortunately
the testcase is extremely vulnerable to compiler changes and therefore not
appropriate for the testsuite.
Bootstrapped and regtested on s390, s390x and i686.It could be used for solving the problem. But it results in inaccuarate
simulated clock and as consequence potentially worse code. The insn in
the group should be issued on right time. So the problem should solved
by advacning clock not changing cost. I'll try to make a patch on this
week and send you for testing. If it is ok, we can commit it in the
OK? Please commit at mainline if so.
2005-02-08 Andreas Krebbel <email@example.com>
* gcc/haifa-sched.c (schedule_block): Make queued sched group
insns return to ready list in the next turn.
RCS file: /cvs/gcc/gcc/gcc/haifa-sched.c,v
retrieving revision 1.251
diff -p -c -r1.251 haifa-sched.c
*** gcc/haifa-sched.c 24 Nov 2004 11:32:22 -0000 1.251
--- gcc/haifa-sched.c 8 Feb 2005 07:16:10 -0000
*************** schedule_block (int b, int rgn_n_insns)
*** 2052,2057 ****
--- 2052,2063 ----
if (cost >= 1)
queue_insn (insn, cost);
+ if (SCHED_GROUP_P (insn))
+ advance = cost;