Search code examples
pipelinecpucpu-architectureintelcpu-hazard

What is False Dependency in CPU?


Can someone help me understand what "false dependency" means?

My professor just explained in this slide why we can't run command 3 before command 1, but why later he called it "False"?

enter image description here


Solution

  • It's "false" because the later instruction doesn't actually need data from earlier instruction. The only conflict is finding a place to put the result. Like the slide says, "not a real data dependency"; only RAW hazards are true dependencies.

    If the CPU invents a temporary location to put the result, until the architectural register is available, it can execute the later instruction independently. Having to wait for this register to be ready is something you can avoid, therefore it's not a true dependency, it's false.

    Register renaming avoids WAR and WAW hazards in general, except for special cases where the CPU treats an instruction as having an input from a register even though the result doesn't depend on any of the bits there.

    Since you tagged this [intel] even though your slide isn't x86 asm, maybe you'd prefer x86 examples: