On 12/9/21 07:59, Martin Liška wrote:
On 12/3/21 15:09, Andrew MacLeod wrote:
On 12/2/21 11:02, Martin Liška wrote:
On 12/2/21 15:27, Andrew MacLeod wrote:
ranger->gori().outgoing_edge_range_p (irange &r, edge e, tree name, *get_global_range_query ());

Thank you! It works for me!

Martin

btw, this applies to names not  on the stmt as well.   The function returns TRUE if there is an outgoing range calculable, and false if not.  so:

a = b + 20
if (a > 40)        <- returns TRUE for outgoing range of 'a' or 'b'
     {
        c = foo()
        if (c > 60)   <- returns false for 'a' or 'b'
            {
                if (b < 100)   <- Also returns TRUE for 'a' or 'b'

Hello.

That's quite interesting support. However, for the bug mentioned earlier in this email conversion, I only want local range for a gcond/gswitch, ignoring all path leading to the statement.

Martin
In which case just directly invoking gori with the global range query should be fine.   You could go directly to the lower level routines like gimple_range_calc_op1, but this saves you from doing a little footwork to call them.  Ultimately, it works out the same for you on the true side of
if (a > 40)
as  setting up and invoking:

   if (gimple_range_calc_op1  (r, stmt, int_range<2> (boolean_true_node, boolean_true_node), [40,40])

Its just less work to do it thru gori()->outgoing_edge_range_p ()   :-)

Andrew

Reply via email to