aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-fold.h
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-fold.h
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-fold.h')
-rw-r--r--gcc/gimple-range-fold.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h
index f2eab72..ce18c66 100644
--- a/gcc/gimple-range-fold.h
+++ b/gcc/gimple-range-fold.h
@@ -96,15 +96,6 @@ range_compatible_p (tree type1, tree type2)
&& TYPE_SIGN (type1) == TYPE_SIGN (type2));
}
-extern tree gimple_range_operand1 (const gimple *s);
-extern tree gimple_range_operand2 (const gimple *s);
-
-// Given stmt S, fill VEC, up to VEC_SIZE elements, with relevant ssa-names
-// on the statement. For efficiency, it is an error to not pass in enough
-// elements for the vector. Return the number of ssa-names.
-
-unsigned gimple_range_ssa_names (tree *vec, unsigned vec_size, gimple *stmt);
-
// Source of all operands for fold_using_range and gori_compute.
// It abstracts out the source of an operand so it can come from a stmt or
// and edge or anywhere a derived class of fur_source wants.
@@ -169,7 +160,8 @@ public:
bool fold_stmt (vrange &r, gimple *s, class fur_source &src,
tree name = NULL_TREE);
protected:
- bool range_of_range_op (vrange &r, gimple *s, fur_source &src);
+ bool range_of_range_op (vrange &r, gimple_range_op_handler &handler,
+ fur_source &src);
bool range_of_call (vrange &r, gcall *call, fur_source &src);
bool range_of_cond_expr (vrange &r, gassign* cond, fur_source &src);
bool range_of_address (irange &r, gimple *s, fur_source &src);