GATE 2015 CS (CS3) – Question 49
Instructions have form OP Ri,Rj,Rk, writing Ri and reading Rj,Rk:
I1 ADD R1,R2,R3
I2 MUL R7,R1,R3
I3 SUB R4,R1,R5
I4 ADD R3,R2,R4
I5 MUL R7,R8,R9S1: I2 and I5 have an anti-dependence. S2: I2 and I4 have an anti-dependence. S3: An anti-dependence always causes a pipeline stall. Which hold?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) S2 only
Explanation
I2 and I5 both write R7, an output dependence rather than anti-dependence. I2 reads R3 before I4 writes it, so S2 is a write-after-read anti-dependence. Such dependencies need not stall an in-order read-before-write pipeline and can be removed by renaming. Thus only S2, B.