Control Flow Graph - Loop Management

Loop Management

A loop header (sometimes called the entry point of the loop) is a dominator that is the target of a loop-forming back edge. The loop header dominates all blocks in the loop body.

Suppose block M is a dominator with several incoming edges, some of them being back edges (so M is a loop header). It is advantageous to several optimization passes to break M up into two blocks Mpre and Mloop. The contents of M and back edges are moved to Mloop, the rest of the edges are moved to point into Mpre, and a new edge from Mpre to Mloop is inserted (so that Mpre is the immediate dominator of Mloop). In the beginning, Mpre would be empty, but passes like loop-invariant code motion could populate it. Mpre is called the loop pre-header, and Mloop would be the loop header.

Read more about this topic:  Control Flow Graph

Famous quotes containing the word management:

    The Management Area of Cherokee
    National Forest, interested in fish,
    Has mapped Tellico and Bald Rivers
    And North River, with the tributaries
    Brookshire Branch and Sugar Cove Creed:
    A fishy map for facile fishery....
    Allen Tate (1899–1979)