Loop Merging - Exit Condition - 2020.1 English

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2020-06-03
Version
2020.1 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.