A method, apparatus, and computer program product are disclosed for
selectively prohibiting speculative conditional branch execution. A
particular type of conditional branch instruction is selected. An
indication is stored within each instruction that is the particular type
of conditional branch instruction. A processor then fetches a first
instruction from code that is to be executed. A determination is made
regarding whether the first instruction includes the indication. In
response to determining that the instruction includes the indication:
speculative execution of the first instruction is prohibited, an actual
location to which the first instruction will branch is resolved, and
execution of the code is branched to the actual location. In response to
determining that the instruction does not include the indication, the
first instruction is speculatively executed.