In r255133 (reapplied r253126) we started to avoid redundant recomputation of LCSSA after loop-unrolling. This patch moves one step further in this direction - now we can avoid it for much wider range of loops, as we start to look at IR and try to figure out if the transformation actually breaks LCSSA phis or makes it necessary to insert new ones.
In future we might go even further and try to fix LCSSA in-place rather than rebuilding it, but I'm not quite sure yet that it's always possible (and computationally cheaper). Anyway, this patch seems to be aligned with that direction.
One of the most important use-cases that previous implementation didn't handle is loops with calls that might throw an exception. Such loops have exits from entire loop nest, but we still don't need to recompute LCSSA after unrolling, as such exits usually don't contain LCSSA phis.
The patch was tested on LNT testsuite + SPECS, neither failures nor significant compile time changes were spotted.
A one-line comment may be welcome :)