On Fri, Apr 26, 2019 at 07:51:05PM +0200, Richard Biener wrote:
> On April 26, 2019 6:59:43 PM GMT+02:00, Segher Boessenkool 
> <seg...@kernel.crashing.org> wrote:
> >So, make it a doloop in gimple, and still have the rtl pass, but that
> >only reverts it to a non-doloop if it turns out it has to.  Does that
> >sound like a good plan?
> 
> Yes, that's more or less what I had in mind. Note that you'd have a doloop 
> early in RTL, sth we might not expect? 

I don't think there are any fundamental reasons to not have that.  Maybe
some adjustments are needed, sure.

> Maybe we already have a GIMPLE way of saying decrement and test zero (one of 
> the overflow builtins?), if not we'd need to add such to have 
> 
>   Flag_1 = IFN_decandtest (i_2);
> If (Flag_1! = 0)
>  ... 
> 
> As 'doloop-end' on GIMPLE. Just adjusting RTL expansion to catch a regular 
> Dec and test would be possible
> As well of course. 

I don't know if we should have any special instructions in GIMPLE for this.
Maybe it is enough to just mark up the loop?  It would be a lot simpler, if
it *works* that is :-)


Segher

Reply via email to