branch prediction does: guesses which way an if-statement will go to keep the pipeline full

Branch predictors guess the outcome of conditional jumps to keep the pipeline full

Image: MODIS Land Rapid Response Team, NASA GSFC, Public domain, via Wikimedia Commons

branch prediction does: guesses which way an if-statement will go to keep the pipeline full

Branch predictors guess the outcome of conditional jumps to keep the pipeline full

Predicting conditional jumps helps avoid pipeline stalls and improves performance.

Example

A processor guessing a conditional jump as "taken" allows the next instruction to fetch early, avoiding a stall.

Remember this

Accurate branch prediction reduces delays and enhances CPU efficiency.

Related concepts

Swipe through 100 ML concepts daily

Open Pocket Polymath