6.5. Avoid Complex Loop-Exit Conditions - If a loop in your component has complex exit conditions, memory accesses or complex operations might be required to evaluate the condition. Subsequent iterations of the loop cannot launch in the loop pipeline until the evaluation completes, which can decrease the overall performance of the loop. - 2025-12-16

Altera High Level Synthesis Compiler Pro Edition Best Practices Guide

Version
24.1

If a loop in your component has complex exit conditions, memory accesses or complex operations might be required to evaluate the condition. Subsequent iterations of the loop cannot launch in the loop pipeline until the evaluation completes, which can decrease the overall performance of the loop.

Use the speculated_iterations pragma to specify how many cycles the loop exit condition can take to compute.