sched.c (adjust_priority): Use ADJUST_PRIORITY if its defined.
authorJeff Law <law@gcc.gnu.org>
Sun, 31 Dec 1995 20:48:17 +0000 (13:48 -0700)
committerJeff Law <law@gcc.gnu.org>
Sun, 31 Dec 1995 20:48:17 +0000 (13:48 -0700)
        * sched.c (adjust_priority): Use ADJUST_PRIORITY if its defined.

        * pa.h (ADJUST_PRIORITY): Define to keep lifetimes of registers
        that will be allocated to %r1 shorter.

From-SVN: r10918

gcc/config/pa/pa.h
gcc/sched.c

index 8e1d89a58ce9383b4bdbba71f45f9db59aa5fb54..b4557768b4ba5df5a24b2b4f6374ea5338f8b59b 100644 (file)
@@ -1719,6 +1719,33 @@ while (0)
 #define ADJUST_COST(INSN,LINK,DEP,COST) \
   (COST) = pa_adjust_cost (INSN, LINK, DEP, COST)
 
+/* Adjust scheduling priorities.  We use this to try and keep addil
+   and the next use of %r1 close together.  */
+#define ADJUST_PRIORITY(PREV) \
+  {                                                            \
+    rtx set = single_set (PREV);                               \
+    rtx src, dest;                                             \
+    if (set)                                                   \
+      {                                                                \
+        src = SET_SRC (set);                                   \
+       dest = SET_DEST (set);                                  \
+       if (GET_CODE (src) == LO_SUM                            \
+           && symbolic_operand (XEXP (src, 1), VOIDmode)       \
+           && ! read_only_operand (XEXP (src, 1), VOIDmode))   \
+         INSN_PRIORITY (PREV) >>= 3;                           \
+        else if (GET_CODE (src) == MEM                         \
+                && GET_CODE (XEXP (src, 0)) == LO_SUM          \
+                && symbolic_operand (XEXP (XEXP (src, 0), 1), VOIDmode)\
+                && ! read_only_operand (XEXP (XEXP (src, 0), 1), VOIDmode))\
+         INSN_PRIORITY (PREV) >>= 1;                           \
+       else if (GET_CODE (dest) == MEM                         \
+                && GET_CODE (XEXP (dest, 0)) == LO_SUM         \
+                && symbolic_operand (XEXP (XEXP (dest, 0), 1), VOIDmode)\
+                && ! read_only_operand (XEXP (XEXP (dest, 0), 1), VOIDmode))\
+         INSN_PRIORITY (PREV) >>= 3;                           \
+      }                                                                \
+  }
+
 /* Handling the special cases is going to get too complicated for a macro,
    just call `pa_adjust_insn_length' to do the real work.  */
 #define ADJUST_INSN_LENGTH(INSN, LENGTH)       \
index 2be6f9d83faa0bcf2a119d2504e979db3445141c..150f68f604971723a186dd3f1c557c9dc1dc047e 100644 (file)
@@ -2563,6 +2563,9 @@ adjust_priority (prev)
            }
          break;
        }
+#ifdef ADJUST_PRIORITY
+      ADJUST_PRIORITY (prev);
+#endif
     }
 }