Hi,

Looking at the way we handle the generic scheduler in AArch64, the order
of includes suggests that we will always match to the generic unit, even
when tuning for a non-generic pipeline.

This patch explicitly prevents that by defining a "generic_sched" attribute,
which is only true when the generic scheduler should be used. We could
probably get away with just including the generic scheduler last in the
list of pipeline descriptions, but this solution is more robust and
prevents us from erroneously using the generic scheduler units where we
would otherwise return "nothing".

Regression tested on aarch64-none-elf with no regressions.

OK?

Thanks,
James

---
2013-09-10  James Greenhalgh  <james.greenha...@arm.com>

        * config/aarch64/aarch64.md (generic_sched): New.
        * config/aarch64/aarch64-generic.md (load): Make conditional
        on generic_sched attribute.
        (nonload): Likewise.
diff --git a/gcc/config/aarch64/aarch64-generic.md b/gcc/config/aarch64/aarch64-generic.md
index cbb75600389efe69f16dd30837ad02b2b254232e..12faac84348c72c44c1c144d268ea9751a0665ac 100644
--- a/gcc/config/aarch64/aarch64-generic.md
+++ b/gcc/config/aarch64/aarch64-generic.md
@@ -30,9 +30,11 @@ (define_attr "is_load" "yes,no"
 	(const_string "no")))
 
 (define_insn_reservation "load" 2
-  (eq_attr "is_load" "yes")
+  (and (eq_attr "generic_sched" "yes")
+       (eq_attr "is_load" "yes"))
   "core")
 
 (define_insn_reservation "nonload" 1
-  (eq_attr "is_load" "no")
+  (and (eq_attr "generic_sched" "yes")
+       (eq_attr "is_load" "no"))
   "core")
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index f37f98f9994bb773785d8573a7efd1e625b5e23a..b56254dbbd78aae9f135b1aeabcf7c43f0f5fd84 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -308,6 +308,14 @@ (define_attr "enabled" "no,yes"
 ;; Processor types.
 (include "aarch64-tune.md")
 
+;; True if the generic scheduling description should be used.
+
+(define_attr "generic_sched" "yes,no"
+  (const (if_then_else
+          (eq_attr "tune" "large,small,cortexa53")
+          (const_string "no")
+          (const_string "yes"))))
+
 ;; Scheduling
 (include "aarch64-generic.md")
 (include "large.md")

Reply via email to