SPRUI04F july 2015 – april 2023
advice #30000: Loop at line 10 cannot be scheduled efficiently,
as it contains a function call ("function_name").
Try to inline call or consider rewriting loop.
The compiler attempts to perform the software pipeline loop optimization at optimization level --opt_level=3 (or -O3). If there is a call in the loop, the compiler will attempt to completely inline the called function, but sometimes this is not possible. If the compiler cannot inline the called function, software pipelining cannot be performed. This can severely reduce the performance of the loop.
In the test case below, the call to the function "func2" prevents software pipelining. Inlining function "func2" or rewriting the loop to avoid a function call can avoid pipeline disqualification. If the loop pipelines successfully you may see performance improvement.
void func1(int *p, int *q, int n)
{
unsigned int i;
for (i = 0; i < n; i++)
{
int t = func2(i);
p[i] = q[i] + t;
}
}