The present invention is directed to an apparatus and method for data
collapsing based on control-flow speculation (conditional branch
predictions). Because conditional branch outcomes are resolved based on
actual data values, the conditional branch prediction provides potentially
valuable insight into data values. Upon encountering a branch if equal
instruction and this instruction is predicted as taken or a branch if not
equal instruction and this instruction is predicted as not taken, this
invention assumes that the two operands used to determine the conditional
branch are equal. The data predictions are safe because a data
misprediction means a conditional branch misprediction which results in a
pipeline flush of the instructions following the conditional branch
instruction including the data mispredictions.