From b40b3035879cf695b72010858b9705a344292bdb Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 20 Sep 2022 16:53:37 -0400 Subject: 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. --- gcc/gimple-range-fold.cc | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'gcc/gimple-range-fold.cc') 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); -- cgit v1.1