summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c75
1 files changed, 31 insertions, 44 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 0d1adce952e..e8a9fec9d66 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -4512,13 +4512,6 @@ if_convert (bool after_combine)
#endif
}
-static bool
-gate_handle_if_conversion (void)
-{
- return (optimize > 0)
- && dbg_cnt (if_conversion);
-}
-
/* If-conversion and CFG cleanup. */
static unsigned int
rest_of_handle_if_conversion (void)
@@ -4545,7 +4538,6 @@ const pass_data pass_data_rtl_ifcvt =
RTL_PASS, /* type */
"ce1", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
true, /* has_execute */
TV_IFCVT, /* tv_id */
0, /* properties_required */
@@ -4563,8 +4555,15 @@ public:
{}
/* opt_pass methods: */
- bool gate () { return gate_handle_if_conversion (); }
- unsigned int execute () { return rest_of_handle_if_conversion (); }
+ virtual bool gate (function *)
+ {
+ return (optimize > 0) && dbg_cnt (if_conversion);
+ }
+
+ virtual unsigned int execute (function *)
+ {
+ return rest_of_handle_if_conversion ();
+ }
}; // class pass_rtl_ifcvt
@@ -4576,22 +4575,9 @@ make_pass_rtl_ifcvt (gcc::context *ctxt)
return new pass_rtl_ifcvt (ctxt);
}
-static bool
-gate_handle_if_after_combine (void)
-{
- return optimize > 0 && flag_if_conversion
- && dbg_cnt (if_after_combine);
-}
-
/* Rerun if-conversion, as combine may have simplified things enough
to now meet sequence length restrictions. */
-static unsigned int
-rest_of_handle_if_after_combine (void)
-{
- if_convert (true);
- return 0;
-}
namespace {
@@ -4600,7 +4586,6 @@ const pass_data pass_data_if_after_combine =
RTL_PASS, /* type */
"ce2", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
true, /* has_execute */
TV_IFCVT, /* tv_id */
0, /* properties_required */
@@ -4618,8 +4603,17 @@ public:
{}
/* opt_pass methods: */
- bool gate () { return gate_handle_if_after_combine (); }
- unsigned int execute () { return rest_of_handle_if_after_combine (); }
+ virtual bool gate (function *)
+ {
+ return optimize > 0 && flag_if_conversion
+ && dbg_cnt (if_after_combine);
+ }
+
+ virtual unsigned int execute (function *)
+ {
+ if_convert (true);
+ return 0;
+ }
}; // class pass_if_after_combine
@@ -4632,21 +4626,6 @@ make_pass_if_after_combine (gcc::context *ctxt)
}
-static bool
-gate_handle_if_after_reload (void)
-{
- return optimize > 0 && flag_if_conversion2
- && dbg_cnt (if_after_reload);
-}
-
-static unsigned int
-rest_of_handle_if_after_reload (void)
-{
- if_convert (true);
- return 0;
-}
-
-
namespace {
const pass_data pass_data_if_after_reload =
@@ -4654,7 +4633,6 @@ const pass_data pass_data_if_after_reload =
RTL_PASS, /* type */
"ce3", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
true, /* has_execute */
TV_IFCVT2, /* tv_id */
0, /* properties_required */
@@ -4672,8 +4650,17 @@ public:
{}
/* opt_pass methods: */
- bool gate () { return gate_handle_if_after_reload (); }
- unsigned int execute () { return rest_of_handle_if_after_reload (); }
+ virtual bool gate (function *)
+ {
+ return optimize > 0 && flag_if_conversion2
+ && dbg_cnt (if_after_reload);
+ }
+
+ virtual unsigned int execute (function *)
+ {
+ if_convert (true);
+ return 0;
+ }
}; // class pass_if_after_reload