aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.cc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2022-09-01 10:34:55 -0400
committerAndrew MacLeod <amacleod@redhat.com>2022-09-22 14:48:12 -0400
commit51ce06385bf259a092f830f1a6dcc4b98757919e (patch)
treef7ea0f2f2b93e69910b98cb38c1a32d2367cf4d1 /gcc/gimple-range.cc
parent24c473a14d3cbe6fc44997122b532cb9406497cb (diff)
downloadgcc-51ce06385bf259a092f830f1a6dcc4b98757919e.zip
gcc-51ce06385bf259a092f830f1a6dcc4b98757919e.tar.gz
gcc-51ce06385bf259a092f830f1a6dcc4b98757919e.tar.bz2
Create gimple_range_op_handler in a new source file.
Range-ops is meant to be IL independent. Some gimple processing has be placed in range-ops, and some is located in gori. Split it all into a file and isolate it in a new class gimple_range_op_handler. * Makefile.in (OBJS): Add gimple-range-op.o. * gimple-range-edge.cc (gimple_outgoing_range_stmt_p): Use gimple_range_op_handler. * gimple-range-fold.cc (gimple_range_base_of_assignment): Move to a method in gimple_range_op_handler. (gimple_range_operand1): Ditto. (gimple_range_operand2): Ditto. (fold_using_range::fold_stmt): Use gimple_range_op_handler. (fold_using_range::range_of_range_op): Ditto. (fold_using_range::relation_fold_and_or): Ditto. (fur_source::register_outgoing_edges): Ditto. (gimple_range_ssa_names): Relocate to gimple-range-op.cc. * gimple-range-fold.h: Adjust prototypes. * gimple-range-gori.cc (gimple_range_calc_op1): Move to a method in gimple_range_op_handler. (gimple_range_calc_op2): Ditto. (gori_compute::compute_operand_range): Use gimple_range_op_handler. (gori_compute::compute_logical_operands): Ditto. (compute_operand1_range): Ditto. (gori_compute::compute_operand2_range): Ditto. (gori_compute::compute_operand1_and_operand2_range): Ditto. * gimple-range-gori.h: Adjust protoypes. * gimple-range-op.cc: New. Supply gimple_range_op_handler methods. * gimple-range-op.h: New. Supply gimple_range_op_handler class. * gimple-range.cc (gimple_ranger::prefill_name): Use gimple_range_op_handler. (gimple_ranger::prefill_stmt_dependencies): Ditto. * gimple-range.h: Include gimple-range-op.h. * range-op.cc (range_op_handler::range_op_handler): Adjust and remove gimple * parameter option. * range-op.h: Adjust prototypes.
Diffstat (limited to 'gcc/gimple-range.cc')
-rw-r--r--gcc/gimple-range.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index eb347ee..d67d649 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -341,7 +341,7 @@ gimple_ranger::prefill_name (vrange &r, tree name)
if (!gimple_range_ssa_p (name))
return;
gimple *stmt = SSA_NAME_DEF_STMT (name);
- if (!range_op_handler (stmt) && !is_a<gphi *> (stmt))
+ if (!gimple_range_op_handler::supported_p (stmt) && !is_a<gphi *> (stmt))
return;
bool current;
@@ -364,7 +364,7 @@ gimple_ranger::prefill_stmt_dependencies (tree ssa)
gcc_checking_assert (stmt && gimple_bb (stmt));
// Only pre-process range-ops and phis.
- if (!range_op_handler (stmt) && !is_a<gphi *> (stmt))
+ if (!gimple_range_op_handler::supported_p (stmt) && !is_a<gphi *> (stmt))
return;
// Mark where on the stack we are starting.
@@ -422,14 +422,15 @@ gimple_ranger::prefill_stmt_dependencies (tree ssa)
}
else
{
- gcc_checking_assert (range_op_handler (stmt));
- tree op = gimple_range_operand2 (stmt);
+ gimple_range_op_handler handler (stmt);
+ gcc_checking_assert (handler);
+ tree op = handler.operand2 ();
if (op)
{
Value_Range r (TREE_TYPE (op));
prefill_name (r, op);
}
- op = gimple_range_operand1 (stmt);
+ op = handler.operand1 ();
if (op)
{
Value_Range r (TREE_TYPE (op));