Below is a paragraph from a book.
In an ordinary superscalar processor, we would use branch prediction to guess which of the given instructions is to be executed, and go down that path. If the processor guesses wrong, the pipeline must be flushed.
Predication execute all of instructions and once the values of the predicate registers are known, commit only the results of the valid instructions. Thus we make use of additional parallel execution units to avoid the delays due to pipeline flushing.
So each predication and branch prediction has disadvantage each. For predication, we have to WAIT until the values of the predicate registers are known. For branch prediction, if prediction is wrong, the pipeline must be flushed which will cause a DELAY. Seems like both predication and branch prediction needs delay.. But to me.. prediction has a chance to avoid delays when prediction is correct leading to conclusion that prediction is better..Predication always needs waiting.
So how do I tell which one is better?? Under what circumstance should I use predication and branch prediction?
Thank you in advance.