diff options
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 178c1d3a517..677c5607090 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 { |