Open In App

GATE | GATE CS 2012 | Question 46

Like Article
Like
Save
Share
Report

Register renaming is done in pipelined processors

(A)

as an alternative to register allocation at compile time

(B)

for efficient access to function parameters and local variables

(C)

to handle certain kinds of hazards

(D)

as part of address translation


Answer: (C)

Explanation:

Register renaming is done to eliminate WAR (Write after Read) and WAW (Write after Write) dependency between instructions which could have caused pipieline stalls. Hence, (C) is the answer.

Example:

I1: Read A to B
I2: Write C to A

Here, there is a WAR dependency and pipeline would need stalls. In order to avoid it register renaming is done and 

Write  C to A
will be 
Write  C to A

WAR dependency is actually called anti-dependency and there is no real dependency except the fact that both uses same memory location. Register renaming can avoid this. Similarly WAW also. 
 


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 30 Sep, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads