Patchwork Scheduler patch: Don't ignore dependencies of asm insns

login
register
mail settings
Submitter Bernd Schmidt
Date Aug. 30, 2010, 2:57 p.m.
Message ID <4C7BC6F1.2030803@codesourcery.com>
Download mbox | patch
Permalink /patch/63048/
State New
Headers show

Comments

Bernd Schmidt - Aug. 30, 2010, 2:57 p.m.
This is the second of the two scheduler patches I need to make a new
port work, which requires accurate schedules for correctness.

When we have an asm statement that depends on a load, we must not
schedule the asm before the load completes.  Currently, dep_cost_1 has a
test for recog_memoized < 0, which is intended to ignore USE and CLOBBER
insns, but also catches asm statements and makes us ignore the cost of
their dependencies.

Fixed with this patch.  Bootstrapped and regression tested on
i686-linux.  Ok?


Bernd
* haifa-sched.c (dep_cost_1): Don't ignore dependencies of asm insns.

Patch

Index: haifa-sched.c
===================================================================
--- haifa-sched.c	(revision 163516)
+++ haifa-sched.c	(working copy)
@@ -864,7 +864,8 @@  dep_cost_1 (dep_t link, dw_t dw)
      This allows the computation of a function's result and parameter
      values to overlap the return and call.  We don't care about the
      the dependence cost when only decreasing register pressure.  */
-  if (recog_memoized (used) < 0)
+  if (recog_memoized (used) < 0 && GET_CODE (PATTERN (used)) != ASM_INPUT
+      && asm_noperands (PATTERN (used)) < 0)
     {
       cost = 0;
       recog_memoized (insn);