diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-08 14:04:37 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-08 14:04:37 +0200 |
commit | 478167be6297adb9774abfea589b6b1d0a7f227e (patch) | |
tree | c64fb4d05bc6d2df0c0fe2e1a7a2146b140e04c9 /gcc/config | |
parent | ee19ef45ba9dc5a783303e353d538e83dabe3377 (diff) | |
download | gcc-478167be6297adb9774abfea589b6b1d0a7f227e.zip gcc-478167be6297adb9774abfea589b6b1d0a7f227e.tar.gz gcc-478167be6297adb9774abfea589b6b1d0a7f227e.tar.bz2 |
gen-pass-instances.awk: Rewritten.
* gen-pass-instances.awk: Rewritten.
* Makefile.in (pass-instances.def): Depend on $(PASSES_EXTRA), pass
$(PASSES_EXTRA) after passes.def to the script.
* config/i386/t-i386 (PASSES_EXTRA): Add i386-passes.def.
* config/i386/i386-passes.def: New file.
* config/i386/i386-protos.h (make_pass_insert_vzeroupper,
make_pass_stv): Declare.
* config/i386/i386.c (pass_stv::pass_stv): Initialize timode_p to
false.
(pass_stv::gate): Depending on timode_p member require TARGET_64BIT
or !TARGET_64BIT.
(pass_stv::clone, pass_stv::set_pass_param): New methods.
(pass_stv::timode_p): New non-static data member.
(ix86_option_override): Don't register passes here.
From-SVN: r240887
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386-protos.h | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 41 | ||||
-rw-r--r-- | gcc/config/i386/t-i386 | 1 |
3 files changed, 24 insertions, 24 deletions
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 8130161..8eeb072 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -338,3 +338,9 @@ struct ix86_first_cycle_multipass_data_ const addr_space_t ADDR_SPACE_SEG_FS = 1; const addr_space_t ADDR_SPACE_SEG_GS = 2; + +namespace gcc { class context; } +class rtl_opt_pass; + +extern rtl_opt_pass *make_pass_insert_vzeroupper (gcc::context *); +extern rtl_opt_pass *make_pass_stv (gcc::context *); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 027e84d..f694611 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4105,13 +4105,15 @@ class pass_stv : public rtl_opt_pass { public: pass_stv (gcc::context *ctxt) - : rtl_opt_pass (pass_data_stv, ctxt) + : rtl_opt_pass (pass_data_stv, ctxt), + timode_p (false) {} /* opt_pass methods: */ virtual bool gate (function *) { - return TARGET_STV && TARGET_SSE2 && optimize > 1; + return (timode_p == !!TARGET_64BIT + && TARGET_STV && TARGET_SSE2 && optimize > 1); } virtual unsigned int execute (function *) @@ -4119,6 +4121,19 @@ public: return convert_scalars_to_vector (); } + opt_pass *clone () + { + return new pass_stv (m_ctxt); + } + + void set_pass_param (unsigned int n, bool param) + { + gcc_assert (n == 0); + timode_p = param; + } + +private: + bool timode_p; }; // class pass_stv } // anon namespace @@ -6150,29 +6165,7 @@ ix86_option_override_internal (bool main_args_p, static void ix86_option_override (void) { - opt_pass *pass_insert_vzeroupper = make_pass_insert_vzeroupper (g); - struct register_pass_info insert_vzeroupper_info - = { pass_insert_vzeroupper, "reload", - 1, PASS_POS_INSERT_AFTER - }; - opt_pass *pass_stv = make_pass_stv (g); - struct register_pass_info stv_info_dimode - = { pass_stv, "combine", - 1, PASS_POS_INSERT_AFTER - }; - /* Run the 64-bit STV pass before the CSE pass so that CONST0_RTX and - CONSTM1_RTX generated by the STV pass can be CSEed. */ - struct register_pass_info stv_info_timode - = { pass_stv, "cse2", - 1, PASS_POS_INSERT_BEFORE - }; - ix86_option_override_internal (true, &global_options, &global_options_set); - - - /* This needs to be done at start up. It's convenient to do it here. */ - register_pass (&insert_vzeroupper_info); - register_pass (TARGET_64BIT ? &stv_info_timode : &stv_info_dimode); } /* Implement the TARGET_OFFLOAD_OPTIONS hook. */ diff --git a/gcc/config/i386/t-i386 b/gcc/config/i386/t-i386 index 9e27a0f..c435c1f 100644 --- a/gcc/config/i386/t-i386 +++ b/gcc/config/i386/t-i386 @@ -18,6 +18,7 @@ OPTIONS_H_EXTRA += $(srcdir)/config/i386/stringop.def TM_H += $(srcdir)/config/i386/x86-tune.def +PASSES_EXTRA += $(srcdir)/config/i386/i386-passes.def i386-c.o: $(srcdir)/config/i386/i386-c.c $(COMPILE) $< |