[4/4] Rename expand_powcabs pass to expand_pow
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Test passed
|
Commit Message
Since cabs expansion was removed from this pass,
it would be good to rename it.
Bootstrapped and tested on x86_64-linux-gnu
gcc/ChangeLog:
* passes.def (expand_pow): Renamed from expand_powcabs.
* timevar.def (TV_TREE_POWCABS): Remove.
(TV_TREE_POW): Add
* tree-pass.h (make_pass_expand_powcabs): Rename to ...
(make_pass_expand_pow): This.
* tree-ssa-math-opts.cc (class pass_expand_powcabs): Rename to ...
(class pass_expand_pow): This.
(pass_expand_powcabs::execute): Rename to ...
(pass_expand_pow::execute): This.
(make_pass_expand_powcabs): Rename to ...
(make_pass_expand_pow): This.
gcc/testsuite/ChangeLog:
* gcc.dg/pow-sqrt-synth-1.c: Update testcase for renamed pass.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
gcc/passes.def | 2 +-
gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c | 4 ++--
gcc/timevar.def | 2 +-
gcc/tree-pass.h | 2 +-
gcc/tree-ssa-math-opts.cc | 25 ++++++++++++-------------
5 files changed, 17 insertions(+), 18 deletions(-)
Comments
On Mon, Jul 1, 2024 at 11:48 PM Andrew Pinski <quic_apinski@quicinc.com> wrote:
>
> Since cabs expansion was removed from this pass,
> it would be good to rename it.
OK
> Bootstrapped and tested on x86_64-linux-gnu
>
> gcc/ChangeLog:
>
> * passes.def (expand_pow): Renamed from expand_powcabs.
> * timevar.def (TV_TREE_POWCABS): Remove.
> (TV_TREE_POW): Add
> * tree-pass.h (make_pass_expand_powcabs): Rename to ...
> (make_pass_expand_pow): This.
> * tree-ssa-math-opts.cc (class pass_expand_powcabs): Rename to ...
> (class pass_expand_pow): This.
> (pass_expand_powcabs::execute): Rename to ...
> (pass_expand_pow::execute): This.
> (make_pass_expand_powcabs): Rename to ...
> (make_pass_expand_pow): This.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/pow-sqrt-synth-1.c: Update testcase for renamed pass.
>
> Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
> gcc/passes.def | 2 +-
> gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c | 4 ++--
> gcc/timevar.def | 2 +-
> gcc/tree-pass.h | 2 +-
> gcc/tree-ssa-math-opts.cc | 25 ++++++++++++-------------
> 5 files changed, 17 insertions(+), 18 deletions(-)
>
> diff --git a/gcc/passes.def b/gcc/passes.def
> index 13c9dc34ddf..b8c21b1e435 100644
> --- a/gcc/passes.def
> +++ b/gcc/passes.def
> @@ -265,7 +265,7 @@ along with GCC; see the file COPYING3. If not see
> NEXT_PASS (pass_ccp, true /* nonzero_p */);
> /* After CCP we rewrite no longer addressed locals into SSA
> form if possible. */
> - NEXT_PASS (pass_expand_powcabs);
> + NEXT_PASS (pass_expand_pow);
> NEXT_PASS (pass_optimize_bswap);
> NEXT_PASS (pass_laddress);
> NEXT_PASS (pass_lim);
> diff --git a/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c b/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c
> index 484b29a8fc8..be81e43ad9a 100644
> --- a/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c
> +++ b/gcc/testsuite/gcc.dg/pow-sqrt-synth-1.c
> @@ -1,5 +1,5 @@
> /* { dg-do compile { target sqrt_insn } } */
> -/* { dg-options "-fdump-tree-powcabs -Ofast --param max-pow-sqrt-depth=8" } */
> +/* { dg-options "-fdump-tree-pow -Ofast --param max-pow-sqrt-depth=8" } */
> /* { dg-additional-options "-mfloat-abi=softfp -mfpu=neon-vfpv4" { target arm*-*-* } } */
>
> double
> @@ -34,4 +34,4 @@ vecfoo (double *a)
> a[i] = __builtin_pow (a[i], 1.25);
> }
>
> -/* { dg-final { scan-tree-dump-times "synthesizing" 7 "powcabs" } } */
> +/* { dg-final { scan-tree-dump-times "synthesizing" 7 "pow" } } */
> diff --git a/gcc/timevar.def b/gcc/timevar.def
> index 6fc36859138..0f9d2c0b032 100644
> --- a/gcc/timevar.def
> +++ b/gcc/timevar.def
> @@ -223,7 +223,7 @@ DEFTIMEVAR (TV_TREE_SWITCH_CONVERSION, "tree switch conversion")
> DEFTIMEVAR (TV_TREE_SWITCH_LOWERING, "tree switch lowering")
> DEFTIMEVAR (TV_TREE_RECIP , "gimple CSE reciprocals")
> DEFTIMEVAR (TV_TREE_SINCOS , "gimple CSE sin/cos")
> -DEFTIMEVAR (TV_TREE_POWCABS , "gimple expand pow/cabs")
> +DEFTIMEVAR (TV_TREE_POW , "gimple expand pow")
> DEFTIMEVAR (TV_TREE_WIDEN_MUL , "gimple widening/fma detection")
> DEFTIMEVAR (TV_TRANS_MEM , "transactional memory")
> DEFTIMEVAR (TV_TREE_STRLEN , "tree strlen optimization")
> diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
> index 38902b1b01b..9843d189d27 100644
> --- a/gcc/tree-pass.h
> +++ b/gcc/tree-pass.h
> @@ -451,7 +451,7 @@ extern gimple_opt_pass *make_pass_early_warn_uninitialized (gcc::context *ctxt);
> extern gimple_opt_pass *make_pass_late_warn_uninitialized (gcc::context *ctxt);
> extern gimple_opt_pass *make_pass_cse_reciprocals (gcc::context *ctxt);
> extern gimple_opt_pass *make_pass_cse_sincos (gcc::context *ctxt);
> -extern gimple_opt_pass *make_pass_expand_powcabs (gcc::context *ctxt);
> +extern gimple_opt_pass *make_pass_expand_pow (gcc::context *ctxt);
> extern gimple_opt_pass *make_pass_optimize_bswap (gcc::context *ctxt);
> extern gimple_opt_pass *make_pass_store_merging (gcc::context *ctxt);
> extern gimple_opt_pass *make_pass_optimize_widening_mul (gcc::context *ctxt);
> diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
> index 71f896a9790..a35caf5f058 100644
> --- a/gcc/tree-ssa-math-opts.cc
> +++ b/gcc/tree-ssa-math-opts.cc
> @@ -2272,17 +2272,16 @@ make_pass_cse_sincos (gcc::context *ctxt)
> return new pass_cse_sincos (ctxt);
> }
>
> -/* Expand powi(x,n) into an optimal number of multiplies, when n is a constant.
> - Note the name is powcabs but cabs expansion was moved to the lower complex
> - pass. */
> +/* Expand powi(x,n) into an optimal number of multiplies, when n is a
> + constant. */
> namespace {
>
> -const pass_data pass_data_expand_powcabs =
> +const pass_data pass_data_expand_pow =
> {
> GIMPLE_PASS, /* type */
> - "powcabs", /* name */
> + "pow", /* name */
> OPTGROUP_NONE, /* optinfo_flags */
> - TV_TREE_POWCABS, /* tv_id */
> + TV_TREE_POW, /* tv_id */
> PROP_ssa, /* properties_required */
> PROP_gimple_opt_math, /* properties_provided */
> 0, /* properties_destroyed */
> @@ -2290,11 +2289,11 @@ const pass_data pass_data_expand_powcabs =
> TODO_update_ssa, /* todo_flags_finish */
> };
>
> -class pass_expand_powcabs : public gimple_opt_pass
> +class pass_expand_pow : public gimple_opt_pass
> {
> public:
> - pass_expand_powcabs (gcc::context *ctxt)
> - : gimple_opt_pass (pass_data_expand_powcabs, ctxt)
> + pass_expand_pow (gcc::context *ctxt)
> + : gimple_opt_pass (pass_data_expand_pow, ctxt)
> {}
>
> /* opt_pass methods: */
> @@ -2305,10 +2304,10 @@ public:
>
> unsigned int execute (function *) final override;
>
> -}; // class pass_expand_powcabs
> +}; // class pass_expand_pow
>
> unsigned int
> -pass_expand_powcabs::execute (function *fun)
> +pass_expand_pow::execute (function *fun)
> {
> basic_block bb;
> bool cfg_changed = false;
> @@ -2421,9 +2420,9 @@ pass_expand_powcabs::execute (function *fun)
> } // anon namespace
>
> gimple_opt_pass *
> -make_pass_expand_powcabs (gcc::context *ctxt)
> +make_pass_expand_pow (gcc::context *ctxt)
> {
> - return new pass_expand_powcabs (ctxt);
> + return new pass_expand_pow (ctxt);
> }
>
> /* Return true if stmt is a type conversion operation that can be stripped
> --
> 2.43.0
>
@@ -265,7 +265,7 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_ccp, true /* nonzero_p */);
/* After CCP we rewrite no longer addressed locals into SSA
form if possible. */
- NEXT_PASS (pass_expand_powcabs);
+ NEXT_PASS (pass_expand_pow);
NEXT_PASS (pass_optimize_bswap);
NEXT_PASS (pass_laddress);
NEXT_PASS (pass_lim);
@@ -1,5 +1,5 @@
/* { dg-do compile { target sqrt_insn } } */
-/* { dg-options "-fdump-tree-powcabs -Ofast --param max-pow-sqrt-depth=8" } */
+/* { dg-options "-fdump-tree-pow -Ofast --param max-pow-sqrt-depth=8" } */
/* { dg-additional-options "-mfloat-abi=softfp -mfpu=neon-vfpv4" { target arm*-*-* } } */
double
@@ -34,4 +34,4 @@ vecfoo (double *a)
a[i] = __builtin_pow (a[i], 1.25);
}
-/* { dg-final { scan-tree-dump-times "synthesizing" 7 "powcabs" } } */
+/* { dg-final { scan-tree-dump-times "synthesizing" 7 "pow" } } */
@@ -223,7 +223,7 @@ DEFTIMEVAR (TV_TREE_SWITCH_CONVERSION, "tree switch conversion")
DEFTIMEVAR (TV_TREE_SWITCH_LOWERING, "tree switch lowering")
DEFTIMEVAR (TV_TREE_RECIP , "gimple CSE reciprocals")
DEFTIMEVAR (TV_TREE_SINCOS , "gimple CSE sin/cos")
-DEFTIMEVAR (TV_TREE_POWCABS , "gimple expand pow/cabs")
+DEFTIMEVAR (TV_TREE_POW , "gimple expand pow")
DEFTIMEVAR (TV_TREE_WIDEN_MUL , "gimple widening/fma detection")
DEFTIMEVAR (TV_TRANS_MEM , "transactional memory")
DEFTIMEVAR (TV_TREE_STRLEN , "tree strlen optimization")
@@ -451,7 +451,7 @@ extern gimple_opt_pass *make_pass_early_warn_uninitialized (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_late_warn_uninitialized (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_cse_reciprocals (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_cse_sincos (gcc::context *ctxt);
-extern gimple_opt_pass *make_pass_expand_powcabs (gcc::context *ctxt);
+extern gimple_opt_pass *make_pass_expand_pow (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_optimize_bswap (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_store_merging (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_optimize_widening_mul (gcc::context *ctxt);
@@ -2272,17 +2272,16 @@ make_pass_cse_sincos (gcc::context *ctxt)
return new pass_cse_sincos (ctxt);
}
-/* Expand powi(x,n) into an optimal number of multiplies, when n is a constant.
- Note the name is powcabs but cabs expansion was moved to the lower complex
- pass. */
+/* Expand powi(x,n) into an optimal number of multiplies, when n is a
+ constant. */
namespace {
-const pass_data pass_data_expand_powcabs =
+const pass_data pass_data_expand_pow =
{
GIMPLE_PASS, /* type */
- "powcabs", /* name */
+ "pow", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- TV_TREE_POWCABS, /* tv_id */
+ TV_TREE_POW, /* tv_id */
PROP_ssa, /* properties_required */
PROP_gimple_opt_math, /* properties_provided */
0, /* properties_destroyed */
@@ -2290,11 +2289,11 @@ const pass_data pass_data_expand_powcabs =
TODO_update_ssa, /* todo_flags_finish */
};
-class pass_expand_powcabs : public gimple_opt_pass
+class pass_expand_pow : public gimple_opt_pass
{
public:
- pass_expand_powcabs (gcc::context *ctxt)
- : gimple_opt_pass (pass_data_expand_powcabs, ctxt)
+ pass_expand_pow (gcc::context *ctxt)
+ : gimple_opt_pass (pass_data_expand_pow, ctxt)
{}
/* opt_pass methods: */
@@ -2305,10 +2304,10 @@ public:
unsigned int execute (function *) final override;
-}; // class pass_expand_powcabs
+}; // class pass_expand_pow
unsigned int
-pass_expand_powcabs::execute (function *fun)
+pass_expand_pow::execute (function *fun)
{
basic_block bb;
bool cfg_changed = false;
@@ -2421,9 +2420,9 @@ pass_expand_powcabs::execute (function *fun)
} // anon namespace
gimple_opt_pass *
-make_pass_expand_powcabs (gcc::context *ctxt)
+make_pass_expand_pow (gcc::context *ctxt)
{
- return new pass_expand_powcabs (ctxt);
+ return new pass_expand_pow (ctxt);
}
/* Return true if stmt is a type conversion operation that can be stripped