On Mon, May 20, 2019 at 08:43:59AM -0600, Jeff Law wrote: > > I think we should have two hooks: one is called with the struct loop as > > parameter; and the other is called for every statement in the loop, if > > the hook isn't null anyway. Or perhaps we do not need that second one. > I'd wait to see a compelling example from real world code where we need > to scan the statements. Otherwise we're just dragging in more target > specific decisions which in fact we want to minimize target stuff.
The ivopts pass will be too optimistic about what loops will end up as a doloop, and cost things accordingly. The cases where we cannot later actually use a doloop are doing pretty much per iteration, so I think ivopts will still make good decisions. We'll need to make the rtl part not actually do a doloop then, but we probably still need that logic anyway. Kewen, Bin, will that work satisfactorily do you think? Segher