aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/epiphany/resolve-sw-modes.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/epiphany/resolve-sw-modes.c')
-rw-r--r--gcc/config/epiphany/resolve-sw-modes.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/gcc/config/epiphany/resolve-sw-modes.c b/gcc/config/epiphany/resolve-sw-modes.c
index 31928fd..fa8fea5 100644
--- a/gcc/config/epiphany/resolve-sw-modes.c
+++ b/gcc/config/epiphany/resolve-sw-modes.c
@@ -38,6 +38,35 @@ along with GCC; see the file COPYING3. If not see
#include "insn-attr-common.h"
#include "tree-pass.h"
+namespace {
+
+const pass_data pass_data_resolve_sw_modes =
+{
+ RTL_PASS, /* type */
+ "resolve_sw_modes", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_execute */
+ TV_MODE_SWITCH, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
+};
+
+class pass_resolve_sw_modes : public rtl_opt_pass
+{
+public:
+ pass_resolve_sw_modes(gcc::context *ctxt)
+ : rtl_opt_pass(pass_data_resolve_sw_modes, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ virtual bool gate (function *) { return optimize; }
+ virtual unsigned int execute (function *);
+
+}; // class pass_resolve_sw_modes
+
/* Clean-up after mode switching:
Check for mode setting insns that have FP_MODE_ROUND_UNKNOWN.
If only one rounding mode is required, select that one.
@@ -45,8 +74,8 @@ along with GCC; see the file COPYING3. If not see
insert new mode setting insns on the edges where the other mode
becomes unambigous. */
-static unsigned
-resolve_sw_modes (void)
+unsigned
+pass_resolve_sw_modes::execute (function *fun)
{
basic_block bb;
rtx insn, src;
@@ -55,15 +84,15 @@ resolve_sw_modes (void)
bool need_commit = false;
bool finalize_fp_sets = (MACHINE_FUNCTION (cfun)->unknown_mode_sets == 0);
- todo.create (last_basic_block_for_fn (cfun));
- pushed = sbitmap_alloc (last_basic_block_for_fn (cfun));
+ todo.create (last_basic_block_for_fn (fun));
+ pushed = sbitmap_alloc (last_basic_block_for_fn (fun));
bitmap_clear (pushed);
if (!finalize_fp_sets)
{
df_note_add_problem ();
df_analyze ();
}
- FOR_EACH_BB_FN (bb, cfun)
+ FOR_EACH_BB_FN (bb, fun)
FOR_BB_INSNS (bb, insn)
{
enum attr_fp_mode selected_mode;
@@ -155,35 +184,6 @@ resolve_sw_modes (void)
return 0;
}
-namespace {
-
-const pass_data pass_data_resolve_sw_modes =
-{
- RTL_PASS, /* type */
- "resolve_sw_modes", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_execute */
- TV_MODE_SWITCH, /* tv_id */
- 0, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */
-};
-
-class pass_resolve_sw_modes : public rtl_opt_pass
-{
-public:
- pass_resolve_sw_modes(gcc::context *ctxt)
- : rtl_opt_pass(pass_data_resolve_sw_modes, ctxt)
- {}
-
- /* opt_pass methods: */
- virtual bool gate (function *) { return optimize; }
- unsigned int execute () { return resolve_sw_modes (); }
-
-}; // class pass_resolve_sw_modes
-
} // anon namespace
rtl_opt_pass *