Commit 7a31e5ef by Richard Sandiford Committed by Richard Sandiford

Use combined_fn in tree-vect-patterns.c

Another patch to extend uses of built_in_function to combined_fn,
this time in tree-vect-patterns.c.  The old code didn't handle the
long double pow variants, but I think that's because noone had a target
that would benefit rather than because the code would mishandle them.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* tree-vect-patterns.c: Include case-cfn-macros.h.
	(vect_recog_pow_pattern): Use combined_fn instead of built-in codes.

From-SVN: r230482
parent c97d1c9d
2015-11-17 Richard Sandiford <richard.sandiford@arm.com> 2015-11-17 Richard Sandiford <richard.sandiford@arm.com>
* tree-vect-patterns.c: Include case-cfn-macros.h.
(vect_recog_pow_pattern): Use combined_fn instead of built-in codes.
2015-11-17 Richard Sandiford <richard.sandiford@arm.com>
* tree-ssa-math-opts.c: Include case-cfn-macros.h. * tree-ssa-math-opts.c: Include case-cfn-macros.h.
(execute_cse_sincos_1): Use combined_fn instead of built-in codes. (execute_cse_sincos_1): Use combined_fn instead of built-in codes.
(pass_cse_sincos::execute): Likewise. (pass_cse_sincos::execute): Likewise.
...@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-vectorizer.h" #include "tree-vectorizer.h"
#include "dumpfile.h" #include "dumpfile.h"
#include "builtins.h" #include "builtins.h"
#include "case-cfn-macros.h"
/* Pattern recognition functions */ /* Pattern recognition functions */
static gimple *vect_recog_widen_sum_pattern (vec<gimple *> *, tree *, static gimple *vect_recog_widen_sum_pattern (vec<gimple *> *, tree *,
...@@ -1009,23 +1010,17 @@ vect_recog_pow_pattern (vec<gimple *> *stmts, tree *type_in, ...@@ -1009,23 +1010,17 @@ vect_recog_pow_pattern (vec<gimple *> *stmts, tree *type_in,
tree *type_out) tree *type_out)
{ {
gimple *last_stmt = (*stmts)[0]; gimple *last_stmt = (*stmts)[0];
tree fn, base, exp = NULL; tree base, exp = NULL;
gimple *stmt; gimple *stmt;
tree var; tree var;
if (!is_gimple_call (last_stmt) || gimple_call_lhs (last_stmt) == NULL) if (!is_gimple_call (last_stmt) || gimple_call_lhs (last_stmt) == NULL)
return NULL; return NULL;
fn = gimple_call_fndecl (last_stmt); switch (gimple_call_combined_fn (last_stmt))
if (fn == NULL_TREE || DECL_BUILT_IN_CLASS (fn) != BUILT_IN_NORMAL)
return NULL;
switch (DECL_FUNCTION_CODE (fn))
{ {
case BUILT_IN_POWIF: CASE_CFN_POW:
case BUILT_IN_POWI: CASE_CFN_POWI:
case BUILT_IN_POWF:
case BUILT_IN_POW:
base = gimple_call_arg (last_stmt, 0); base = gimple_call_arg (last_stmt, 0);
exp = gimple_call_arg (last_stmt, 1); exp = gimple_call_arg (last_stmt, 1);
if (TREE_CODE (exp) != REAL_CST if (TREE_CODE (exp) != REAL_CST
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment