This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] haifa-sched: SCHED_GROUP_P ignored for queued insn

Andreas Krebbel wrote:


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

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.

Bootstrapped and regtested on s390, s390x and i686.

OK? Please commit at mainline if so.

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




2005-02-08 Andreas Krebbel <>

* gcc/haifa-sched.c (schedule_block): Make queued sched group insns return to ready list in the next turn.

Index: gcc/haifa-sched.c
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;
+ break;
+ }
+ continue;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]