[AArch64] Use new target pass registration framework for FMA steering pass
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Mon, 17 Oct 2016 16:37:38 +0000 (16:37 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Mon, 17 Oct 2016 16:37:38 +0000 (16:37 +0000)
* config/aarch64/aarch64.c: Delete inclusion of
cortex-a57-fma-steering.h.
(aarch64_override_options): Delete call
to aarch64_register_fma_steering.
* config/aarch64/aarch64-protos.h (make_pass_fma_steering): Declare.
* config/aarch64/cortex-a57-fma-steering.h: Delete.
* config/aarch64/aarch64-passes.def: New file.
* config/aarch64/cortex-a57-fma-steering.c
(aarch64_register_fma_steering): Delete definition.
(make_pass_fma_steering): Remove static qualifier.
* config/aarch64/t-aarch64 (PASSES_EXTRA): New directive.
(cortex-a57-fma-steering.o): Remove dependency on
cortex-a57-fma-steering.h.

From-SVN: r241248

gcc/ChangeLog
gcc/config/aarch64/aarch64-passes.def [new file with mode: 0644]
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/cortex-a57-fma-steering.c
gcc/config/aarch64/cortex-a57-fma-steering.h [deleted file]
gcc/config/aarch64/t-aarch64

index 2ad0bb5cd4d5466b37d34c4a07b26926d764c0cb..92d06ce27664b3a12ca304d4e8b24ef9fde224a2 100644 (file)
@@ -1,3 +1,19 @@
+2016-10-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * config/aarch64/aarch64.c: Delete inclusion of
+       cortex-a57-fma-steering.h.
+       (aarch64_override_options): Delete call
+       to aarch64_register_fma_steering.
+       * config/aarch64/aarch64-protos.h (make_pass_fma_steering): Declare.
+       * config/aarch64/cortex-a57-fma-steering.h: Delete.
+       * config/aarch64/aarch64-passes.def: New file.
+       * config/aarch64/cortex-a57-fma-steering.c
+       (aarch64_register_fma_steering): Delete definition.
+       (make_pass_fma_steering): Remove static qualifier.
+       * config/aarch64/t-aarch64 (PASSES_EXTRA): New directive.
+       (cortex-a57-fma-steering.o): Remove dependency on
+       cortex-a57-fma-steering.h.
+
 2016-10-17  Eric Botcazou  <ebotcazou@adacore.com>
 
        * explow.c (validize_mem): Do not modify the argument in-place.
diff --git a/gcc/config/aarch64/aarch64-passes.def b/gcc/config/aarch64/aarch64-passes.def
new file mode 100644 (file)
index 0000000..7fe8039
--- /dev/null
@@ -0,0 +1,21 @@
+/* AArch64-specific passes declarations.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   Contributed by ARM Ltd.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+INSERT_PASS_AFTER (pass_regrename, 1, pass_fma_steering);
index 07a8cd0455d64a861cb919083a9d369bf23724b7..4f4989d8b0da91096000d0b51736eaa5b0aa9474 100644 (file)
@@ -463,4 +463,6 @@ enum aarch64_parse_opt_result aarch64_parse_extension (const char *,
 std::string aarch64_get_extension_string_for_isa_flags (unsigned long,
                                                        unsigned long);
 
+rtl_opt_pass *make_pass_fma_steering (gcc::context *ctxt);
+
 #endif /* GCC_AARCH64_PROTOS_H */
index 74f1a6ad0580114405ca654b25059689578f10dc..6b27309337b4e34f877fbdb632f177bf38b681e0 100644 (file)
@@ -62,7 +62,6 @@
 #include "rtl-iter.h"
 #include "tm-constrs.h"
 #include "sched-int.h"
-#include "cortex-a57-fma-steering.h"
 #include "target-globals.h"
 #include "common/common-target.h"
 
@@ -8554,9 +8553,6 @@ aarch64_override_options (void)
      while processing functions with potential target attributes.  */
   target_option_default_node = target_option_current_node
       = build_target_option_node (&global_options);
-
-  aarch64_register_fma_steering ();
-
 }
 
 /* Implement targetm.override_options_after_change.  */
index 214db4a101072cd1121add83a678cfe7092a0581..8b4384c2937a93748df9f24479ba19281a0e69f5 100644 (file)
@@ -36,7 +36,6 @@
 #include "context.h"
 #include "tree-pass.h"
 #include "regrename.h"
-#include "cortex-a57-fma-steering.h"
 #include "aarch64-protos.h"
 
 /* For better performance, the destination of FMADD/FMSUB instructions should
@@ -1069,21 +1068,8 @@ public:
 
 /* Create a new fma steering pass instance.  */
 
-static rtl_opt_pass *
+rtl_opt_pass *
 make_pass_fma_steering (gcc::context *ctxt)
 {
   return new pass_fma_steering (ctxt);
 }
-
-/* Register the FMA steering pass to the pass manager.  */
-
-void
-aarch64_register_fma_steering ()
-{
-  opt_pass *pass_fma_steering = make_pass_fma_steering (g);
-
-  struct register_pass_info fma_steering_info
-    = { pass_fma_steering, "rnreg", 1, PASS_POS_INSERT_AFTER };
-
-  register_pass (&fma_steering_info);
-}
diff --git a/gcc/config/aarch64/cortex-a57-fma-steering.h b/gcc/config/aarch64/cortex-a57-fma-steering.h
deleted file mode 100644 (file)
index 65bf5ac..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This file contains declarations for the FMA steering optimization
-   pass for Cortex-A57.
-   Copyright (C) 2015-2016 Free Software Foundation, Inc.
-   Contributed by ARM Ltd.
-
-   This file is part of GCC.
-
-   GCC is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3, or (at your option)
-   any later version.
-
-   GCC is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with GCC; see the file COPYING3.  If not see
-   <http://www.gnu.org/licenses/>.  */
-
-void aarch64_register_fma_steering (void);
index 778e15c9652d298472926b5bb29b4b02166bc5f2..04eb63666e8db38367235fc82bb55f826eb8af9a 100644 (file)
@@ -56,12 +56,13 @@ aarch64-c.o: $(srcdir)/config/aarch64/aarch64-c.c $(CONFIG_H) $(SYSTEM_H) \
        $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
                $(srcdir)/config/aarch64/aarch64-c.c
 
+PASSES_EXTRA += $(srcdir)/config/aarch64/aarch64-passes.def
+
 cortex-a57-fma-steering.o: $(srcdir)/config/aarch64/cortex-a57-fma-steering.c \
     $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(REGS_H) insn-config.h $(RTL_BASE_H) \
     dominance.h cfg.h cfganal.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(RECOG_H) \
     output.h hash-map.h $(DF_H) $(OBSTACK_H) $(TARGET_H) $(RTL_H) \
     $(CONTEXT_H) $(TREE_PASS_H) regrename.h \
-    $(srcdir)/config/aarch64/cortex-a57-fma-steering.h \
     $(srcdir)/config/aarch64/aarch64-protos.h
        $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
                $(srcdir)/config/aarch64/cortex-a57-fma-steering.c