Abstract
x
is only available att=5
, as that’s when the first instruction (x <- y + z
) completes. However, the second instruction (w <- x
) requiresx
att=3
. If not handled properly, this discrepancy can lead to incorrect results.
How to handle this?
A RAW (Read After Write) hazard can be addressed with a Pipeline Stall which is a performance hit. Luckily, we can optimise this using Operand Forwarding and Out-of-Order Execution.