aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2016-12-09 19:56:02 +0000
committerWilliam Schmidt <wschmidt@gcc.gnu.org>2016-12-09 19:56:02 +0000
commit5715e98017b383266517d5b723b6c7f53cdb75fc (patch)
tree4d2d7eccf4d6cb7a05bc001fee4cc7b4f0dfd0e4 /gcc/config
parent46c0848272468db3d6f9a7ed0666331359cd1b49 (diff)
downloadgcc-5715e98017b383266517d5b723b6c7f53cdb75fc.zip
gcc-5715e98017b383266517d5b723b6c7f53cdb75fc.tar.gz
gcc-5715e98017b383266517d5b723b6c7f53cdb75fc.tar.bz2
rs6000-passes.def: New file.
2016-12-09 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * config/rs6000/rs6000-passes.def: New file. * config/rs6000/rs6000-protos.h: Declare make_pass_analyze_swaps. * config/rs6000/rs6000.c (rs6000_option_override): Remove registration of machine-specific passes. (pass_analyze_swaps::clone): New function. * config/rs6000/t-rs6000: Define PASSES_EXTRA. From-SVN: r243504
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/rs6000/rs6000-passes.def27
-rw-r--r--gcc/config/rs6000/rs6000-protos.h7
-rw-r--r--gcc/config/rs6000/rs6000.c14
-rw-r--r--gcc/config/rs6000/t-rs60001
4 files changed, 40 insertions, 9 deletions
diff --git a/gcc/config/rs6000/rs6000-passes.def b/gcc/config/rs6000/rs6000-passes.def
new file mode 100644
index 0000000..19e7c33
--- /dev/null
+++ b/gcc/config/rs6000/rs6000-passes.def
@@ -0,0 +1,27 @@
+/* Description of target passes for rs6000
+ Copyright (C) 2016 Free Software Foundation, Inc.
+
+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/>. */
+
+/*
+ Macros that can be used in this file:
+ INSERT_PASS_AFTER (PASS, INSTANCE, TGT_PASS)
+ INSERT_PASS_BEFORE (PASS, INSTANCE, TGT_PASS)
+ REPLACE_PASS (PASS, INSTANCE, TGT_PASS)
+ */
+
+ INSERT_PASS_BEFORE (pass_cse, 1, pass_analyze_swaps);
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 989557f..1aa8966 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -258,4 +258,11 @@ extern unsigned char rs6000_class_max_nregs[][LIM_REG_CLASSES];
extern unsigned char rs6000_hard_regno_nregs[][FIRST_PSEUDO_REGISTER];
extern bool rs6000_linux_float_exceptions_rounding_supported_p (void);
+
+/* Pass management. */
+namespace gcc { class context; }
+class rtl_opt_pass;
+
+extern rtl_opt_pass *make_pass_analyze_swaps (gcc::context *);
+
#endif /* rs6000-protos.h */
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index f0c1354..55e9548 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -5203,15 +5203,6 @@ static void
rs6000_option_override (void)
{
(void) rs6000_option_override_internal (true);
-
- /* Register machine-specific passes. This needs to be done at start-up.
- It's convenient to do it here (like i386 does). */
- opt_pass *pass_analyze_swaps = make_pass_analyze_swaps (g);
-
- struct register_pass_info analyze_swaps_info
- = { pass_analyze_swaps, "cse1", 1, PASS_POS_INSERT_BEFORE };
-
- register_pass (&analyze_swaps_info);
}
@@ -41865,6 +41856,11 @@ public:
return rs6000_analyze_swaps (fun);
}
+ opt_pass *clone ()
+ {
+ return new pass_analyze_swaps (m_ctxt);
+ }
+
}; // class pass_analyze_swaps
rtl_opt_pass *
diff --git a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000
index f72f729..17369f4 100644
--- a/gcc/config/rs6000/t-rs6000
+++ b/gcc/config/rs6000/t-rs6000
@@ -20,6 +20,7 @@
TM_H += $(srcdir)/config/rs6000/rs6000-builtin.def
TM_H += $(srcdir)/config/rs6000/rs6000-cpus.def
+PASSES_EXTRA += $(srcdir)/config/rs6000/rs6000-passes.def
rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c
$(COMPILE) $<