From a6efab5fbc468b6f98a7522295b7991d2036588b Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Mon, 25 Jul 2022 16:42:00 +0200 Subject: Dispatch code for floating point range ops. This modifies the range-op dispatch code to handle floats. Also provided are the stub routines for the floating point range-ops, as we need something to dispatch to ;-). I am not ecstatic about the dispatch code, but there's no getting around having to switch on the tree code and type in some manner. All the other alternatives I played with ended up being slower, or harder to maintain. At least, this one is self-contained in the range_op_handler API, and less than 0.16% slower for VRP in our benchmarks. Tested on x86-64 Linux. gcc/ChangeLog: * Makefile.in (OBJS): Add range-op-float.o. * range-op.cc (get_float_handler): New. (range_op_handler::range_op_handler): Save code and type for delayed querying. (range_op_handler::oeprator bool): Move from header file, and add support for floats. (range_op_handler::fold_range): Add support for floats. (range_op_handler::op1_range): Same. (range_op_handler::op2_range): Same. (range_op_handler::lhs_op1_relation): Same. (range_op_handler::lhs_op2_relation): Same. (range_op_handler::op1_op2_relation): Same. * range-op.h (class range_operator_float): New. (class floating_op_table): New. * value-query.cc (range_query::get_tree_range): Add case for REAL_CST. * range-op-float.cc: New file. --- gcc/value-query.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/value-query.cc') diff --git a/gcc/value-query.cc b/gcc/value-query.cc index decf5aa..4af8eca 100644 --- a/gcc/value-query.cc +++ b/gcc/value-query.cc @@ -211,6 +211,7 @@ range_query::get_tree_range (vrange &r, tree expr, gimple *stmt) switch (TREE_CODE (expr)) { case INTEGER_CST: + case REAL_CST: if (TREE_OVERFLOW_P (expr)) expr = drop_tree_overflow (expr); r.set (expr, expr); -- cgit v1.1