aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-simd-clone.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-02-13 09:34:42 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-02-13 09:34:42 +0100
commit848bb6fc0e502345536b25e1a110eb7f01eccbc1 (patch)
treed7abb7ffececb36706b28e05151701a372dc8cc5 /gcc/omp-simd-clone.c
parentf4b29321048fa82c754f04814dbd46d92773e72a (diff)
downloadgcc-848bb6fc0e502345536b25e1a110eb7f01eccbc1.zip
gcc-848bb6fc0e502345536b25e1a110eb7f01eccbc1.tar.gz
gcc-848bb6fc0e502345536b25e1a110eb7f01eccbc1.tar.bz2
re PR middle-end/84309 (Wrong-code with -ffast-math)
PR middle-end/84309 * match.pd (pow(C,x) -> exp(log(C)*x)): Optimize instead into exp2(log2(C)*x) if C is a power of 2 and c99 runtime is available. * generic-match-head.c (canonicalize_math_after_vectorization_p): New inline function. * gimple-match-head.c (canonicalize_math_after_vectorization_p): New inline function. * omp-simd-clone.h: New file. * omp-simd-clone.c: Include omp-simd-clone.h. (expand_simd_clones): No longer static. * tree-vect-patterns.c: Include fold-const-call.h, attribs.h, cgraph.h and omp-simd-clone.h. (vect_recog_pow_pattern): Optimize pow(C,x) to exp(log(C)*x). (vect_recog_widen_shift_pattern): Formatting fix. (vect_pattern_recog_1): Don't check optab for calls. * gcc.dg/pr84309.c: New test. * gcc.target/i386/pr84309.c: New test. From-SVN: r257617
Diffstat (limited to 'gcc/omp-simd-clone.c')
-rw-r--r--gcc/omp-simd-clone.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c
index b7737a2..56832eb 100644
--- a/gcc/omp-simd-clone.c
+++ b/gcc/omp-simd-clone.c
@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "varasm.h"
#include "stringpool.h"
#include "attribs.h"
+#include "omp-simd-clone.h"
/* Return the number of elements in vector type VECTYPE, which is associated
with a SIMD clone. At present these always have a constant length. */
@@ -1568,7 +1569,7 @@ simd_clone_adjust (struct cgraph_node *node)
/* If the function in NODE is tagged as an elemental SIMD function,
create the appropriate SIMD clones. */
-static void
+void
expand_simd_clones (struct cgraph_node *node)
{
tree attr = lookup_attribute ("omp declare simd",