Loop Optimization Pragmas - Analog Devices VISUALDSP++ 3.5 Manual

C/c++ compiler and library for adsp-219x processors
Hide thumbs Also See for VISUALDSP++ 3.5:
Table of Contents

Advertisement

For example,
#pragma interrupt
#pragma altregisters
void field_SIG()
{
/* ISR code */
}

Loop Optimization Pragmas

Loop optimization pragmas give the compiler additional information
about usage within a particular loop, which allows the compiler to per-
form more aggressive optimization. The pragmas are placed before the
loop statement, and apply to the statement that immediately follows,
which must be a
most effective to apply loop pragmas to inner-most loops, since the com-
piler can achieve the most savings there.
The optimizer always attempts to vectorize loops when it is safe to do so.
The optimizer exploits the information generated by the interprocedural
analysis (see
"Interprocedural Analysis" on page
where it knows it is safe to do so. Consider the following code:
void copy(short *a, short *b) {
int i;
for (i=0; i<100; i++)
a[i] = b[i];
}
If you call
copy
interprocedural analysis will not be able to tell that "
Therefore, the optimizer cannot be sure that one iteration of the loop is
not dependent on the data calculated by the previous iteration of the loop.
If it is known that each iteration of the loop is not dependent on the pre-
vious iteration, then the
notify the compiler that this is the case.
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
,
or
statement to have effect. In general, it is
for
while
do
with two calls, say
vector_for
1-57) to increase the cases
and later
copy(x,y)
a
pragma can be used to explicitly
Compiler
, the
copy(y,z)
" never aliases "
".
b
1-123

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?

Questions and answers

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents