Loop Merging - Exit Condition - 2020.2 English

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2020-11-24
Version
2020.2 English

Description

This message is to inform the user that the code is violating loop merging optimization rules.

Explanation

For loop merging optimization to take place, the loops should not have multiple exit conditions as shown in the following code:

void example_label(int A[50], int B[50]) {
  int i=0;
#pragma HLS loop_merge force
  do{
 
     B[i] = A[i] + 5;
     if(B[i]==A[i]*B[i])
     {
         break;
     }
     else if (B[i] == A[i]+B[i])
     {
         break;
     }
  i++;
  }while(i<50);
 i=0;
  do{
  B[i] = A[i] + 5;
  i++;
  }while(i<50);

Solution

Make sure there is only one exit condition among the loops.