On 09/11/2015 11:49 PM, Nathan Sidwell wrote:
This patch implements that optimization. As the comment at the head of the code says, we first find 'cycle-equivalent' BBs. These are ones that we determine are in the same (set of) loops, in the closed graph. Such equivalent BBs form the entry and exit BBs of an SESE region. Once we've found these, we need to find the ones that cover the most of the graph -- and delete the ones that are consumed by the larger areas. This is done by a coloring algorithm executed as a DFS walk. One of the properties of SESE regions is that they are always strictly nested -- they never partially overlap. That property is used by the coloring algorithm.
This looks like it could potentially go into sese.c instead. Bernd