A branch prediction unit includes a local branch prediction and a global
branch prediction. A global branch prediction utilizes a global history
shift register to record the behavior of conditional branches. In some
cases, a conditional branch may behave in a static manner, either always
being taken or not taken, while resident in an instruction cache. Such
static behaving conditional branches do not need a global history for
prediction and contend with other conditional branches for global branch
history training. By utilizing a dynamic branch classification scheme,
branches requiring global history prediction can be identified and static
behaving conditional branches may be prevented from polluting the global
history. All conditional branches are initially classified as local and do
not participate in global history training. Only after two mispredictions
are branches recognized as exhibiting dynamic behavior and classified as
global. These branches classified as global may then participate in global
history training and utilize a global history based branch prediction.