Definition
Branch Misprediction Penalty
The branch misprediction penalty is the amount of lost work caused by a wrongly predicted branch.
In a pipelined processor, this is usually measured by how many wrong-path instructions must be flushed, or equivalently by how many cycles are lost before execution continues on the correct path.
The penalty depends on how late the branch outcome is known. If the branch is resolved only in the execute stage, then younger instructions may already have entered the pipeline and must be discarded when the prediction was wrong.
Example
Two flushed instructions
Consider a classic five-stage pipeline in which a branch is resolved in the execute stage.
If the processor has already fetched the next two sequential instructions, and the branch then turns out to go to a different target, those two instructions lie on the wrong path and must be flushed.
In that case, the branch misprediction penalty is instructions.