summaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-20 15:50:26 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-20 15:50:26 +0000
commit2cac353da1d1c2cf2a3c96d22aa17ca784960854 (patch)
tree7c56f6bd15fe4c1e8050bc6fbe899c1f27ee8cd1 /gcc/tree-if-conv.c
parent0616321d358449ed779ef8d8bb23742681407138 (diff)
downloadgcc-2cac353da1d1c2cf2a3c96d22aa17ca784960854.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172774 138bc75d-0d04-0410-961f-82ee72b054a4
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 7ca6deec123..450ddb294b0 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))