TopicsbasicblocksBasicblocks

Basic block identification

/images/basicblocks/basicblock1.jpg

Control Flow Graph

/images/basicblocks/basicblock2.webp

Optimizations using basic blocks

The following example shows how after constant propagation followed by constant folding

/images/basicblocks/optimization1.gif

the arrow corresponding to the else dissapears in the graph and we can conclude that we can remove the else code (and the condition checking) since is not reachable.

/images/basicblocks/optimization2.gif