From 80f78716c2c7ce1b7f96077c35c1dd474a2086a2 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 16 Aug 2022 13:18:37 -0400 Subject: Abstract interesting ssa-names from GORI. Provide a routine to pick out the ssa-names from interesting statements. * gimple-range-fold.cc (gimple_range_ssa_names): New. * gimple-range-fold.h (gimple_range_ssa_names): New prototype. * gimple-range-gori.cc (range_def_chain::get_def_chain): Move code to new routine. --- gcc/gimple-range-fold.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/gimple-range-fold.h') diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h index c2f381d..f2eab72 100644 --- a/gcc/gimple-range-fold.h +++ b/gcc/gimple-range-fold.h @@ -96,6 +96,14 @@ 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 @@ -150,9 +158,6 @@ protected: relation_oracle *m_oracle; }; -extern tree gimple_range_operand1 (const gimple *s); -extern tree gimple_range_operand2 (const gimple *s); - // This class uses ranges to fold a gimple statement producinf a range for // the LHS. The source of all operands is supplied via the fur_source class // which provides a range_query as well as a source location and any other -- cgit v1.1