Branch predictions

To minimize branch misprediction penalties in hot paths, you should _____

A

Ensure branches are highly predictable (consistent direction)

B

Insert a memory fence before the branch so the predictor observes a settled value

C

Use likely/unlikely compiler hints or [[likely]]/[[unlikely]] attributes

D

Eliminate branches using branchless techniques like cmov or arithmetic

E

Replace the hot branch with an indirect jump through a function-pointer table so the BTB caches the target