Skip to content

Commit

Permalink
[Grammar] 11-2 Basic Block.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dendibakh authored Aug 10, 2024
1 parent 59e14f3 commit d8c4948
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@


## Basic Block {#sec:BasicBlock}

A basic block is a sequence of instructions with a single entry and a single exit. Figure @fig:BasicBlock shows a simple example of a basic block, where `MOV` instruction is an entry, and `JA` is an exit instruction. While a basic block can have one or many predecessors and successors, no instruction in the middle can enter or exit a basic block.
A basic block is a sequence of instructions with a single entry and a single exit. Figure @fig:BasicBlock shows a simple example of a basic block, where the `MOV` instruction is an entry, and `JA` is an exit instruction. While a basic block can have one or many predecessors and successors, no instruction in the middle can enter or exit a basic block.

![Basic Block of assembly instructions.](../../img/cpu_fe_opts/BasicBlock.png){#fig:BasicBlock width=50% }

It is guaranteed that every instruction in the basic block will be executed exactly once. This is an important property that is leveraged by many compiler transformations. For example, it greatly reduces the problem of control flow graph analysis and transformations since, for some class of problems, we can treat all instructions in the basic block as one entity.
It is guaranteed that every instruction in the basic block will be executed exactly once. This is an important property that is leveraged by many compiler transformations. For example, it greatly reduces the problem of control flow graph analysis and transformations since, for some classes of problems, we can treat all instructions in the basic block as one entity.

0 comments on commit d8c4948

Please sign in to comment.