The Gateway to Computer Science Excellence
+3 votes
Number of WAR dependencies possible

R1 <- R3 + R2

R3 <- R3 + R5

R3 <- R2 + R3

Is it 2 or 3?
in CO and Architecture by Active (1.5k points) | 94 views
it's 2
Answer is 3.  They have taken I1-I3 also as WAR.
3 is correct ...

you should consider all cases ... (combination)

1 Answer

0 votes
As there are 3 WAR dependencies I1 I2,I2 I3 and I1 I3.But the WAR dependency I1 I3 is using register R3 whose value is updated in I2.So we can neglect I1 I3 dependency.

I think 2 must be the ans.
by (307 points)
What if it would have been R4 <- R3 + R5 as second instruction instead of R3 <- R3 + R5
then it would be two   instruction 1 to 3 and intrusion  2 to 3
Why is 1-3 not a WAR in original question ? Reordering of instruction can take place and hence dependency is also possible.

I need confirmation on this. Maybe @Arjun sir can help.
it is 2 . As 1 time write done then after that all dependency depend on that only.

So, R1 has no dependency on R3
Are you sure? because in one answer @habib khan sir considered every possible dependency even the one in which variable was updated already.
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,324 answers
105,169 users