Check out my first novel, midnight's simulacra!

Compiler Design: Difference between revisions

From dankwiki
No edit summary
No edit summary
Line 1: Line 1:
==Control Flow==
==Control Flow Analysis==
==Control Flow Graph==
The first instruction of the program is a leader, as is every target of a branch, and every instruction following a branch (including conditional branches and procedure returns) is a leader. A basic block is the largest sequence of instructions that can only be entered via the first (''leader'') instruction, and only exited by the last instruction (''terminator'', although this is not common terminology). A basic block a ''flows'' to b if and only if:
The first instruction of the program is a leader, as is every target of a branch, and every instruction following a branch (including conditional branches and procedure returns) is a leader. A basic block is the largest sequence of instructions that can only be entered via the first (''leader'') instruction, and only exited by the last instruction (''terminator'', although this is not common terminology). A basic block a ''flows'' to b if and only if:
* either b immediately follows a, and a does not end in an unconditional branch,
* either b immediately follows a, and a does not end in an unconditional branch,