FlowGraphNormalizer =================== .. java:package:: fr.inria.tapenade.representation :noindex: .. java:type:: public final class FlowGraphNormalizer Detects the loop nesting and dfst ordering between the Blocks of a newly built FlowGraph. Also detects dead (not connected) blocks. Constructors ------------ FlowGraphNormalizer ^^^^^^^^^^^^^^^^^^^ .. java:constructor:: protected FlowGraphNormalizer(EntryBlock entryBlock, TapList allBlocks, ExitBlock exitBlock) :outertype: FlowGraphNormalizer Creates a FlowGraphNormalizer for the FlowGraph starting at "entryBlock", ending at "exitBlock" and knowing that "allBlocks" is the list of all blocks in this FlowGraph. Methods ------- condenseFG ^^^^^^^^^^ .. java:method:: protected void condenseFG(boolean finalGraph) :outertype: FlowGraphNormalizer Sweeps through the FlowGraph, using the allBlocks list, looking for mergings of BasicBlock's, and of FGArrow's, and removing empty Block's and empty IF's and Loop's . :param finalGraph: true to get a more aggressive condensationin the end. findOptimalLoops ^^^^^^^^^^^^^^^^ .. java:method:: protected TapList findOptimalLoops() :outertype: FlowGraphNormalizer Explores the nesting of loops. Makes a reasonable decision about which Block's are in which loops, and which Block's should become the HeaderBlock's of these loops. Also computes the DFST order of the FlowGraph for this particular decision of loops. When this function returns, all blocks have been turned into BasicBlock's or HeaderBlock's according to the above decision, LoopBlock's are created and now contain in their "inside" field the DFST list of their immediately enclosed Block's. The output of this function is the DFST list of the top level Block's. getDeadBlocks ^^^^^^^^^^^^^ .. java:method:: protected TapList getDeadBlocks() :outertype: FlowGraphNormalizer Must be run just after findOptimalLoops. :return: the list of Block's detected as dead, because they are unreachable, i.e. not marked "VISITED" at the end of "findOptimalLoops". makeSurePrivateDeclarationsBlock ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void makeSurePrivateDeclarationsBlock(Unit unit) :outertype: FlowGraphNormalizer Make sure block 0 can serve as host for additional local declarations. If not (loop header, many entries...) then insert another empty block 0 that will do the job. :param unit: current unit. sortFlowArrows ^^^^^^^^^^^^^^ .. java:method:: protected void sortFlowArrows() :outertype: FlowGraphNormalizer For each Block, sorts the flow FGarrows that exit from this block. The resulting conventional order will give a better block numbering during the DFST.