568 views

1 Answer

0 votes
0 votes
Loop unrolling is generally done to reduce the number of condition checking and branching. Branching and control instruction create control hazards in the pipelining mechanism. We use several approaches to deal with this control hazard, either we take some branch prediction or we put NOP (stall cycles) in the pipeline. In this particular question, the loop is running two times. If a compiler does not perform any loop unrolling then there will condition check for 3 times, and each of the time either we stall the pipeline or use some branch prediction. Suppose if we are using stall mechanism then 3 times we need to stall the pipeline. But due to unrolling, this condition check, hence the number of control hazard reduces. As the loop is running only two times and unrolling is done we do not need to consider any control hazards and directly can compute the number of cycles required.

Related questions

0 votes
0 votes
1 answer
1
Deepak9000 asked Nov 5, 2023
255 views
I have a Self doubt question on Operand Forwarding . The data forwarded should be done in EX-EX stage or Mem-EX ? Which one to follow and when ?Using EX-EX we require les...
1 votes
1 votes
1 answer
4
Hirak asked May 23, 2019
586 views
Is pipeline hazards there in the syllabus? And are there any previous year questions from there?