Course: Computer Architectures
Lecture: Lecture 07 - Instruction-Level Parallelism
Definition
Register renaming assigns different storage names to distinct values that would otherwise share a register. It removes register antidependences (WAR) and output dependences (WAW), while preserving true data flow (RAW).
The compiler can select temporary registers statically; hardware can track separate physical versions dynamically. Static transformations must respect available registers, branches, and values needed after the transformed region. Dynamic renaming must preserve the architectural register view and support recovery.
Slide example (34-37)
fdiv.d f0, f2, f4
fadd.d f6, f0, f8
fsd f6, 0(x1)
fsub.d f8, f10, f14
fmul.d f6, f10, f8The divide supplies the add’s f0. The add reads the old f8; the subtract produces a new f8 for the multiply. The add and multiply also produce different values both named f6.
Removing the f8 antidependence
The add can be delayed waiting for the divide. If the subtract overwrites f8 before the add reads it, the add receives the wrong version.
The slide introduces a temporary T:
fdiv.d f0, f2, f4
fadd.d f6, f0, f8
fsd f6, 0(x1)
fsub.d T, f10, f14
fmul.d f6, f10, TRename both the subtract’s destination and the multiply’s matching input. The add continues to read old f8; the multiply reads T. Renaming only the destination would leave the multiply consuming the wrong value.
T is a symbolic temporary, not a literal RISC-V register. Static allocation must choose a suitable available FP register.
Removing the f6 output dependence
The slide separately introduces temporary S for the add result and its store:
fdiv.d f0, f2, f4
fadd.d S, f0, f8
fsd S, 0(x1)
fsub.d f8, f10, f14
fmul.d f6, f10, f8Now the add and multiply write distinct storage. The store follows the add’s S value rather than the multiply’s final f6.
The original also has a WAR relation between the store’s read of f6 and the multiply’s write of f6; giving the stored add result a separate name removes that shared-name constraint too.
Combining the two transformations
This study reconstruction uses both symbolic temporaries:
fdiv.d f0, f2, f4
fadd.d S, f0, f8
fsd S, 0(x1)
fsub.d T, f10, f14
fmul.d f6, f10, TRemaining true dependencies:
divide -> add -> store
subtract -> multiplyThe subtract/multiply chain can become ready while the divide is still working, subject to resources and commit/recovery constraints. Renaming creates no new arithmetic hardware and does not remove the divide-to-add wait.
Preserving values after the region
The original code leaves the subtract result in f8. The T version must preserve that result if later code uses f8. A compiler must update those later uses or place a copy back at a safe point; the displayed slide fragment alone does not establish that f8 is dead afterward.
The original final f6 comes from the multiply, while the store must receive the earlier add’s value. Correct renaming tracks the definition needed by each use rather than globally replacing every occurrence of a name.
For static allocation, S and T must not overwrite any live input or intermediate. For hardware renaming, physical versions remain internal, with ordered architectural visibility and recovery such as that discussed in Precise Exceptions.
Related and source
Instruction Dependencies, RAW and WAW Hazards, Multicycle Operations, Precise Exceptions, Loop Unrolling and SIMD.
E. Sanchez, Instruction Level Parallelism, ASE 2026/27, slides 33-38. PDF: Instruction Level Parallelism.pdf. T and S examples reproduce the slide transformations; combined transformation and live-value qualifications are study explanations.
Dynamic scheduling connection
Tomasulo implements producer-based renaming with reservation-station identifiers. Follow the four-instruction example to see a register mapping change while an earlier consumer keeps its original producer. Tomasulo Dynamic Scheduling