Hello,
I'm trying to optimize a short function for the C64x+:
#include "IQmath_inline_all.h"
void cw(int * restrict w, int wl, const int * restrict c, int nc, int b)
{
int i, j, a;
_nassert((int) w % 8 == 0);
#pragma MUST_ITERATE(0, 2, 1);
for (j = 1; j < nc; j += 2) {
#pragma MUST_ITERATE(512, 51200, 512);
for (i = 0, a = 0; i < (wl >> 1); ++i, a += j*b)
*(w + i) -= _IQ30rsmpy(*(c + j), _IQ30cosPU(a));
}
}
It uses the IQmath library (source code) and the two functions seem to get inlined. The compiler is part of the "C6000 Code Generation Tools 7.3.0" (CCS 4.2.4.00033). The following compiler options are used:
-mv64plus --symdebug:skeletal -O3 --define=xdc_target_types__=ti/targets/std.h --define=_INLINE_IQMATH --diag_warning=225 --debug_software_pipeline --optimizer_interlist --opt_for_speed=4 --gen_opt_info=2 --single_inline --gen_profile_info -k --src_interlist --preproc_with_compile
The problem is that, according to the .asm file, the loop does not get software pipelined. Instead, the following message is displayed:
Disqualified loop: Loop contains control code
What do I need to change to have the compiler software pipeline the loop? Where is the "control code" in the loop when both functions called are inlined ("inlineable" according to .nfo file)?
Thank you for your support.