diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-15 16:47:36 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-15 16:47:36 +0000 |
commit | 42fb263f7d576645d79203952ecfc45dcdd4980e (patch) | |
tree | 7eb4f52fdc63295571a2791013191373cd326269 /gcc/sched-deps.c | |
parent | 1789bced611716847847f09f3543885871f88638 (diff) | |
download | gcc-42fb263f7d576645d79203952ecfc45dcdd4980e.tar.gz |
2013-01-15 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/pr55153
* sched-deps.c (sched_analyze_2): Add pending reads for prefetch.
2013-01-15 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/pr55153
* gcc.dg/pr55153.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195211 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r-- | gcc/sched-deps.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index f61e837847f..3f37aa026c9 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -2707,6 +2707,20 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn) case PREFETCH: if (PREFETCH_SCHEDULE_BARRIER_P (x)) reg_pending_barrier = TRUE_BARRIER; + /* Prefetch insn contains addresses only. So if the prefetch + address has no registers, there will be no dependencies on + the prefetch insn. This is wrong with result code + correctness point of view as such prefetch can be moved below + a jump insn which usually generates MOVE_BARRIER preventing + to move insns containing registers or memories through the + barrier. It is also wrong with generated code performance + point of view as prefetch withouth dependecies will have a + tendency to be issued later instead of earlier. It is hard + to generate accurate dependencies for prefetch insns as + prefetch has only the start address but it is better to have + something than nothing. */ + add_insn_mem_dependence (deps, true, insn, + gen_rtx_MEM (Pmode, XEXP (PATTERN (insn), 0))); break; case UNSPEC_VOLATILE: |