The present invention relates to a processing unit for executing
instructions in a computer system and to a method in such a processing
unit. According to the present invention a decision is made whether or
not to base execution on a value prediction (P), wherein the decision is
based on information associated with the estimated time gain of execution
based on a correct prediction. According to an embodiment of the present
invention the decision regarding whether or not to execute speculatively
is based on information regarding whether a cache hit or a cache miss is
detected in connection with a load instruction. In an alternative
embodiment of the present invention the decision is based on information
regarding the dependency depth of the load instruction, i.e. the number
of instructions that are dependent on the load.