diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2016-06-07 13:22:26 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2016-06-07 11:22:26 +0000 |
commit | ce120587f3810484e8b939b7df69320d9f39420c (patch) | |
tree | ac682fe7cfb00fbb346d33d65ef0332beab85aad /gcc/gimple.c | |
parent | 701b9a47bd1a19ba1625a5f1ecbc4b7d064c7e10 (diff) | |
download | gcc-ce120587f3810484e8b939b7df69320d9f39420c.zip gcc-ce120587f3810484e8b939b7df69320d9f39420c.tar.gz gcc-ce120587f3810484e8b939b7df69320d9f39420c.tar.bz2 |
gimple.c: Include builtins.h
* gimple.c: Include builtins.h
(gimple_inexpensive_call_p): New function.
* gimple.h (gimple_inexpensive_call_p): Declare.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use it.
* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise;
fix formatting.
From-SVN: r237172
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 178c1d3..677c560 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-walk.h" #include "gimplify.h" #include "target.h" +#include "builtins.h" #include "selftest.h" #include "gimple-pretty-print.h" @@ -3025,6 +3026,19 @@ maybe_remove_unused_call_args (struct function *fn, gimple *stmt) } } +/* Return false if STMT will likely expand to real function call. */ + +bool +gimple_inexpensive_call_p (gcall *stmt) +{ + if (gimple_call_internal_p (stmt)) + return true; + tree decl = gimple_call_fndecl (stmt); + if (decl && is_inexpensive_builtin (decl)) + return true; + return false; +} + #if CHECKING_P namespace selftest { |