Types of branches
How to mitigate branch delays
Speculation: Predicting branches, executing in anticipation.
Predication: Removing branches, converting code into one that depends on outcome of a condition for a commit.
3 Components of a branch
Two Step Branching
Three Step Branching
True or False: Unbundling increases code size.
True: 2 step leads to 14% code growth. 3 step leads to 28% growth.
True or False: In a VLIW architecture with unbundled branches, the branch targets must be computed once for all clusters
False. The branch will be executed in one cluster, not all.
True or False: The branch condition is computed in one cluster and broadcast to all other clusters
True
True or False: If the branch condition is taken, each cluster transfers control to one branch target.
False. Clusters only need to be notified of which branch is taken, but they do not affect control of other clusters.
True or False: All branch targets correspond to the same logical block
True.
Speculation
Ignore branches and move operations above them
Conservative Techniques
Unless legality of reordering can be proven, always serialize operations
Speculative Techniques
Executes ahead based on probabilistic assumptions, and fixes the execution if speculation is wrong.
Control speculation
Removes control dependence