In its simplest form, a table of 2-bit saturating counters is indexed by the low bits of the PC. A two-level adaptive variant adds a local history table: the PC selects a per-branch shift register of recent outcomes, which then indexes a pattern history table of counters.
Unlike a global branch predictor, a local predictor cannot exploit correlations between different branches. It can, however, capture per-branch patterns — such as a single branch that alternates taken / not taken — which a global predictor may miss if that pattern is drowned out by other branches in the global history.
Examples
1-Bit Branch Prediction
Consider the same nested loop as in the global predictor example, but now with a 1-bit local predictor: each branch has its ownBHT entry, indexed by its PC.
Comparison with global predictor 2/5 mispredictions as the global case. But the local predictor has separate counters: L11's counter stays PNT throughout the inner loop and only trains after L11 executes. In subsequent outer loops, L11 predicts correctly, dropping the misprediction rate below the global case. The local predictor isolates each branch's history — L09's exit behaviour never corrupts L11's counter.