Scheduler patch: Don't ignore dependencies of asm insns

Message ID
State New
Headers show

Commit Message

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?

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


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);