+2015-11-17 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-vect-patterns.c: Include internal-fn.h.
+ (vect_recog_pow_pattern): Use IFN_SQRT instead of BUILT_IN_SQRT*.
+
2015-11-17 Richard Sandiford <richard.sandiford@arm.com>
* tree.h (BUILTIN_EXP10_P, BUILTIN_EXPONENT_P, BUILTIN_SQRT_P)
#include "tree-vectorizer.h"
#include "dumpfile.h"
#include "builtins.h"
+#include "internal-fn.h"
#include "case-cfn-macros.h"
/* Pattern recognition functions */
if (TREE_CODE (exp) == REAL_CST
&& real_equal (&TREE_REAL_CST (exp), &dconsthalf))
{
- tree newfn = mathfn_built_in (TREE_TYPE (base), BUILT_IN_SQRT);
*type_in = get_vectype_for_scalar_type (TREE_TYPE (base));
- if (*type_in)
+ if (*type_in && direct_internal_fn_supported_p (IFN_SQRT, *type_in))
{
- gcall *stmt = gimple_build_call (newfn, 1, base);
- if (vectorizable_function (stmt, *type_in, *type_in)
- != NULL_TREE)
- {
- var = vect_recog_temp_ssa_var (TREE_TYPE (base), stmt);
- gimple_call_set_lhs (stmt, var);
- return stmt;
- }
+ gcall *stmt = gimple_build_call_internal (IFN_SQRT, 1, base);
+ var = vect_recog_temp_ssa_var (TREE_TYPE (base), stmt);
+ gimple_call_set_lhs (stmt, var);
+ return stmt;
}
}