diff options
author | liuhongt <hongtao.liu@intel.com> | 2022-07-19 11:22:24 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2022-07-20 16:11:21 +0800 |
commit | 78d5e125c008d87cb2e1c08a9ff2a02d4214ffcf (patch) | |
tree | c5c1c2fd8e3ec2b012da79e5fe88185d7fcc453f /gcc/tree-pass.h | |
parent | f9d4c3b45c5ed5f45c8089c990dbd4e181929c3d (diff) | |
download | gcc-78d5e125c008d87cb2e1c08a9ff2a02d4214ffcf.zip gcc-78d5e125c008d87cb2e1c08a9ff2a02d4214ffcf.tar.gz gcc-78d5e125c008d87cb2e1c08a9ff2a02d4214ffcf.tar.bz2 |
Move pass_cse_sincos after vectorizer.
__builtin_cexpi can't be vectorized since there's gap between it and
vectorized sincos version(In libmvec, it passes a double and two
double pointer and returns nothing.) And it will lose some
vectorization opportunity if sin & cos are optimized to cexpi before
vectorizer.
I'm trying to add vect_recog_cexpi_pattern to split cexpi to sin and
cos, but it failed vectorizable_simd_clone_call since NULL is returned
by cgraph_node::get (fndecl). So alternatively, the patch try to move
pass_cse_sincos after vectorizer, just before pas_cse_reciprocals.
Also original pass_cse_sincos additionaly expands pow&cabs, this patch
split that part into a separate pass named pass_expand_powcabs which
remains the old pass position.
gcc/ChangeLog:
* passes.def: (Split pass_cse_sincos to pass_expand_powcabs
and pass_cse_sincos, and move pass_cse_sincos after vectorizer).
* timevar.def (TV_TREE_POWCABS): New timevar.
* tree-pass.h (make_pass_expand_powcabs): Split from pass_cse_sincos.
* tree-ssa-math-opts.cc (gimple_expand_builtin_cabs): Ditto.
(class pass_expand_powcabs): Ditto.
(pass_expand_powcabs::execute): Ditto.
(make_pass_expand_powcabs): Ditto.
(pass_cse_sincos::execute): Remove pow/cabs expand part.
(make_pass_cse_sincos): Ditto.
gcc/testsuite/ChangeLog:
* gcc.dg/pow-sqrt-synth-1.c: Adjust testcase.
Diffstat (limited to 'gcc/tree-pass.h')
-rw-r--r-- | gcc/tree-pass.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 606d1d6..4dfe05e 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -444,6 +444,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_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); |