[PATCH] Add if-chain to switch conversion pass.

Martin Liška mliska@suse.cz
Tue Oct 6 13:09:58 GMT 2020


On 10/6/20 2:56 PM, Andrew MacLeod wrote:
> Ah, by just using the outgoing_range class, all you are getting is static edges.  so a TRUE edge is always a [1,1] and a false edge is [0,0]
> I provided that class so you could get the constant edges on switches.
> 
> if you want to get actual ranges for ssa-names, you will need the ranger (which I think is going in today).  It uses those values as the starting point for winding back to calculate other dependent names.

Ah, all right!

> 
> Then  you will want to query the ranger for the range of index_5 on that edge..

Fine! So the only tricky thing here is to select a proper SSA_NAME to query right?
In my case I need to cover situations like:

   index.0_1 = (unsigned int) index_5(D);
   _2 = index.0_1 + 4294967287;
   if (_2 <= 114)

or

     _1 = aChar_8(D) == 1;
     _2 = aChar_8(D) == 10;
     _3 = _1 | _2;
     if (_3 != 0)

Anything Ranger can help me with?

Martin

> 
> so you will need a gimple ranger instance instead of an outgoing_range object.
> 
> Andrew



More information about the Gcc-patches mailing list