Machine-translated by Google. Questions are authored in English.
Top

Discussion

Loop fusion combines two adjacent loops when

  • A.the compiler cannot determine their iteration counts
  • B.they iterate over the same range and are independent
  • C.one of them contains no statements in its body
  • D.they are both nested inside a third outer loop

Answer: B

Merging halves the loop overhead and can improve locality by touching the same data once instead of twice. A dependence between the loops makes the transformation unsafe. Matching iteration ranges are also required before the loops can be merged.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.