aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-fold.cc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2022-09-20 16:53:37 -0400
committerAndrew MacLeod <amacleod@redhat.com>2022-09-22 14:48:29 -0400
commitb40b3035879cf695b72010858b9705a344292bdb (patch)
tree95ba68b08dc3d79bc073f63687f5d7fd13693ddf /gcc/gimple-range-fold.cc
parent2f92f685da2ef9e82ee6262519919180df8f2dd9 (diff)
downloadgcc-b40b3035879cf695b72010858b9705a344292bdb.zip
gcc-b40b3035879cf695b72010858b9705a344292bdb.tar.gz
gcc-b40b3035879cf695b72010858b9705a344292bdb.tar.bz2
Add range-ops support for builtin functions.
Convert CFN_BUILT_IN_CONSTANT_P as first POC. * gimple-range-fold.cc (fold_using_range::range_of_builtin_int_call): Remove case for CFN_BUILT_IN_CONSTANT_P. * gimple-range-op.cc (gimple_range_op_handler::supported_p): Check if a call also creates a range-op object. (gimple_range_op_handler): Also check builtin calls. (class cfn_constant_float_p): New. Float CFN_BUILT_IN_CONSTANT_P. (class cfn_constant_p): New. Integral CFN_BUILT_IN_CONSTANT_P. (gimple_range_op_handler::maybe_builtin_call): Set arguments and handler for supported built-in calls. * gimple-range-op.h (maybe_builtin_call): New prototype.
Diffstat (limited to 'gcc/gimple-range-fold.cc')
-rw-r--r--gcc/gimple-range-fold.cc17
1 files changed, 0 insertions, 17 deletions
diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index 4240825..63a1f51 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -944,23 +944,6 @@ fold_using_range::range_of_builtin_int_call (irange &r, gcall *call,
switch (func)
{
- case CFN_BUILT_IN_CONSTANT_P:
- {
- arg = gimple_call_arg (call, 0);
- Value_Range tmp (TREE_TYPE (arg));
- if (src.get_operand (tmp, arg) && tmp.singleton_p ())
- {
- r.set (build_one_cst (type), build_one_cst (type));
- return true;
- }
- if (cfun->after_inlining)
- {
- r.set_zero (type);
- return true;
- }
- break;
- }
-
case CFN_BUILT_IN_SIGNBIT:
{
arg = gimple_call_arg (call, 0);