aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-04-20 15:50:26 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-04-20 15:50:26 +0000
commitd7978bff88f8db16bf28b247d4882c49eaccd623 (patch)
tree7c56f6bd15fe4c1e8050bc6fbe899c1f27ee8cd1 /gcc/tree-if-conv.c
parent9d12f71a54d11f490dca17c9d1f8a8fdf442dcb9 (diff)
downloadgcc-d7978bff88f8db16bf28b247d4882c49eaccd623.zip
gcc-d7978bff88f8db16bf28b247d4882c49eaccd623.tar.gz
gcc-d7978bff88f8db16bf28b247d4882c49eaccd623.tar.bz2
re PR c/47892 (Fails to vectorize comparison code, if-conversion fails)
2011-04-20 Richard Guenther <rguenther@suse.de> PR tree-optimization/47892 * tree-if-conv.c (if_convertible_stmt_p): Const builtins are if-convertible. * gcc.dg/vect/fast-math-ifcvt-1.c: New testcase. From-SVN: r172774
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 7ca6dee..450ddb2 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -719,6 +719,22 @@ if_convertible_stmt_p (gimple stmt, VEC (data_reference_p, heap) *refs)
case GIMPLE_ASSIGN:
return if_convertible_gimple_assign_stmt_p (stmt, refs);
+ case GIMPLE_CALL:
+ {
+ tree fndecl = gimple_call_fndecl (stmt);
+ if (fndecl)
+ {
+ int flags = gimple_call_flags (stmt);
+ if ((flags & ECF_CONST)
+ && !(flags & ECF_LOOPING_CONST_OR_PURE)
+ /* We can only vectorize some builtins at the moment,
+ so restrict if-conversion to those. */
+ && DECL_BUILT_IN (fndecl))
+ return true;
+ }
+ return false;
+ }
+
default:
/* Don't know what to do with 'em so don't do anything. */
if (dump_file && (dump_flags & TDF_DETAILS))