On Tue, Oct 06, 2020 at 03:48:38PM +0200, Martin Liška wrote: > On 10/6/20 9:47 AM, Richard Biener wrote: > > But is it really extensible with the current implementation? I doubt so. > > I must agree with the statement. So let's make the pass properly. > I would need a help with the algorithm where I'm planning to do the following > steps: > > 1) for each BB ending with a gcond, parse index variable and it's VR; > I'll support: > a) index == 123 ([123, 123]) > b) 1 <= index && index <= 9 ([1, 9]) > c) index == 123 || index == 12345 ([123, 123] [12345, 12345]) > d) index != 1 ([1, 1]) > e) index != 1 && index != 5 ([1, 1] [5, 5])
The fold_range_test created cases are essential to support, so f) index - 123U < 456U ([123, 456+123]) g) (unsigned) index - 123U < 456U (ditto) but the discovery should actually recurse on all of those forms, so it will handle (unsigned) index - 123U < 456U || (unsigned) index - 16384U <= 32711U etc. You can see what reassoc init_range_entry does and do something similar? Jakub