dalibocai
dalibocai

Reputation: 2347

optimization possibilities for known loop trip counts

What can a compiler do for optimization if it knows the loop trip count of a loop? Loop unrolling is one.What are others?

Upvotes: 3

Views: 384

Answers (1)

Ira Baxter
Ira Baxter

Reputation: 95400

  • Avoidance of loop-skip-check on loop entry (many modern languages allow loops to have zero iterations, but you have to check on entry)
  • Better SIMDization (blocking the loop iterations into chunks processable by small vectors)
  • Removal of subscript range checking (or diagnosis of error) (for those languages that insist)

Upvotes: 1

Related Questions