On Thu, 20 Dec 2012, Steven Bosscher wrote: > On Thu, Dec 20, 2012 at 1:43 PM, Richard Biener wrote: > > --- 724,746 ---- > > > > cfg_hooks->merge_blocks (a, b); > > > > if (current_loops != NULL) > > { > > ! /* If the block we merge into is a loop header do nothing unless > > ... */ > > ! if (a->loop_father->header == a) > > ! { > > ! /* ... we merge two loop headers, in which case we kill > > ! the inner loop. */ > > Before loops were maintained, we'd simply re-discover the nested > loops. Do we now lose this information?
When we merge loop headers we effectively merge two loops (in this case cross-jumping merged the latches and the headers). We re-discover the nest when multiple latches remain and we disambiguate loops with multiple latches. > How about adjusting the can_merge_blocks hook to reject merging loop headers? I didn't want to do that, but sure - that's another possibility. In this case the outer loop is really unnecessary. Richard.