gccint: Control Flow

1 
1 15 Control Flow Graph
1 *********************
1 
1 A control flow graph (CFG) is a data structure built on top of the
1 intermediate code representation (the RTL or 'GIMPLE' instruction
1 stream) abstracting the control flow behavior of a function that is
1 being compiled.  The CFG is a directed graph where the vertices
1 represent basic blocks and edges represent possible transfer of control
1 flow from one basic block to another.  The data structures used to
1 represent the control flow graph are defined in 'basic-block.h'.
1 
1  In GCC, the representation of control flow is maintained throughout the
1 compilation process, from constructing the CFG early in 'pass_build_cfg'
1 to 'pass_free_cfg' (see 'passes.def').  The CFG takes various different
1 modes and may undergo extensive manipulations, but the graph is always
1 valid between its construction and its release.  This way, transfer of
1 information such as data flow, a measured profile, or the loop tree, can
1 be propagated through the passes pipeline, and even from 'GIMPLE' to
1 'RTL'.
1 
1  Often the CFG may be better viewed as integral part of instruction
1 chain, than structure built on the top of it.  Updating the compiler's
1 intermediate representation for instructions can not be easily done
1 without proper maintenance of the CFG simultaneously.
1 

Menu