Hi,
I have some trouble to pipeline my loops. here is the code of type of loops I have to pipeline:
int sizex = 256;
int sizey = 256;
int nb = 3;
uint16_t P[256*256];
uint16_t H[256*256];
uint16_t * restrict in = P;
uint16_t * restrict out = H;
uint16_t steps[7]={ 290 , 3539 , 15862 , 26154 , 15862 , 3539 , 290};
int x, y; /*position in image of current pixels*/
int i; /*iterate over pixels*/
int s; /*iterate over steps*/
uint32_t tmp; /*accumulator*/
for(y=0; y<sizey; y++)
{
/*left border*/
for(x=0; x<nb; x++)
{
tmp = 0;
for(i=0, s=(nb-x); i<(nb + x + 1); i++, s++)
{
tmp += (uint32_t)in[y*sizex + i]*steps[s];
}
*out++ = tmp>>16;
}
/*nominal case*/
for(x=nb; x<(sizex-nb); x++)
{
tmp = 0;
for(i=(x-nb), s=0; i<=(x+nb); i++, s++)
{
tmp += (uint32_t)in[y*sizex + i]*steps[s];
}
*out++ = tmp>>16;
}
/*right border*/
for(x=(sizex-nb); x<sizex; x++)
{
tmp = 0;
for(i=x-nb, s=0; i<sizex; i++, s++)
{
tmp += (uint32_t)in[y*sizex + i]*steps[s];
}
*out++ = tmp>>16;
}
}
Then, I have this after building my project.
;*----------------------------------------------------------------------------*
;* SOFTWARE PIPELINE INFORMATION
;* Disqualified loop: Loop contains control code
;* (Performance) Loop at line 47 cannot be scheduled efficiently, as it contains complex conditional expression. Try to simplify condition.
;*----------------------------------------------------------------------------*
Here is my configuration:
-mv6600 -O3 --opt_for_speed=5 --include_path="/home/gugautie/ti/ccsv6/tools/compiler/ti-cgt-c6000_8.1.0/include" --include_path="/home/gugautie/ti/dsplib_c66x_3_1_0_0/inc" --include_path="/home/gugautie/ti/imglib_c66x_3_1_1_0/inc" --include_path="/home/gugautie/ti/mathlib_c66x_3_0_1_1/inc" --advice:performance=all -g --diag_wrap=off --diag_warning=225 --debug_software_pipeline --auto_inline=0 --openmp --gen_profile_info -k --asm_listing
Why the compilator can't pipeline my loop?
Thanks for your time,
Guillaume