mbox series

[0/5] some small ranger op table cleanup

Message ID 20240806212714.308434-1-quic_apinski@quicinc.com
Headers show
Series some small ranger op table cleanup | expand

Message

Andrew Pinski Aug. 6, 2024, 9:27 p.m. UTC
This is a set of 5 small cleanups for the ranger op table.
I noticed it after was pointed out an uninitialized warning
sometimes happens for it. We should use final classes a lot more,
even if it just used for documentation that you can't use it as a
base class. Also local instances should really be in an anonymous
namespaces but they were missing.

Note there is some unused classes/instances I noticed after putting
them in an anonymous namespace so I `#if 0`ed then. Should we just
remove them instead? They were the pointer related ops which was just
added too.

Andrew Pinski (5):
  range: Make range_op_table class final
  range: Make range_op_table a true singleton class [PR116209]
  ranger: constify range_op_table class
  ranger: Make some classes local to the TU
  ranger: Fix LTO uninitialized variable warning about m_range_tree

 gcc/range-op-float.cc | 27 +++++++++++++++++++--------
 gcc/range-op-ptr.cc   | 20 +++++++++++++++-----
 gcc/range-op.cc       | 19 ++++++++++++++-----
 gcc/range-op.h        | 16 +++++++++++-----
 4 files changed, 59 insertions(+), 23 deletions(-)

Comments

Andrew MacLeod Aug. 6, 2024, 10:06 p.m. UTC | #1
On 8/6/24 17:27, Andrew Pinski wrote:
> This is a set of 5 small cleanups for the ranger op table.
> I noticed it after was pointed out an uninitialized warning
> sometimes happens for it. We should use final classes a lot more,
> even if it just used for documentation that you can't use it as a
> base class. Also local instances should really be in an anonymous
> namespaces but they were missing.
>
> Note there is some unused classes/instances I noticed after putting
> them in an anonymous namespace so I `#if 0`ed then. Should we just
> remove them instead? They were the pointer related ops which was just
> added too.
>
> Andrew Pinski (5):
>    range: Make range_op_table class final
>    range: Make range_op_table a true singleton class [PR116209]
>    ranger: constify range_op_table class
>    ranger: Make some classes local to the TU
>    ranger: Fix LTO uninitialized variable warning about m_range_tree
>
>   gcc/range-op-float.cc | 27 +++++++++++++++++++--------
>   gcc/range-op-ptr.cc   | 20 +++++++++++++++-----
>   gcc/range-op.cc       | 19 ++++++++++++++-----
>   gcc/range-op.h        | 16 +++++++++++-----
>   4 files changed, 59 insertions(+), 23 deletions(-)
>
I'm fine with all these.

Regarding patch 4 with the unused pointer entries, I think they should 
be deleted.  I believe they are subsumed by 
operator_min/operator_max/operator_and/operator_or versions of 
fold_range which take a prange operand.

Ie the code in pointer_min_max_operator::wi_fold () is basically the 
same as operator_max::fold_range (prange &r, ...) which is what is 
currently called for pointers.

I think its a remnant of the previous version before prange and dispatch 
came along.

Thanks

Andrew