This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC] Don't schedule prefetch INSNs
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 May 2009 17:21:04 +0200
- Subject: [RFC] Don't schedule prefetch INSNs
Hi,
I'm experimenting with prefetching instructions in the S/390 back-end
and found it rather annoying that the instruction scheduler shuffles
them around. Is that intended behaviour? When emitting a prefetch
instruction I usually want it to reside exactly where I emitted it and
especially don't want memory accesses to be moved over it. The
attached patch fixes it for me. Does that make sense?
Bye,
-Andreas-
2009-05-19 Andreas Krebbel <krebbel1@de.ibm.com>
* sched-deps.c (sched_analyze_2): Consider prefetch INSNs to be a
scheduling barrier.
Index: gcc/sched-deps.c
===================================================================
*** gcc/sched-deps.c.orig 2009-02-26 08:43:06.000000000 +0100
--- gcc/sched-deps.c 2009-05-19 13:32:58.000000000 +0200
*************** sched_analyze_2 (struct deps *deps, rtx
*** 2132,2137 ****
--- 2132,2141 ----
flush_pending_lists (deps, insn, true, false);
break;
+ case PREFETCH:
+ reg_pending_barrier = TRUE_BARRIER;
+ break;
+
case UNSPEC_VOLATILE:
flush_pending_lists (deps, insn, true, true);
/* FALLTHRU */