Digital Signal Processing Reference
In-Depth Information
problem is modeled as an interference graph where two variables interfere if they are
in the same basic block and there is no dependence between them. The interference
is weighted according to the number of potentially parallel memory accesses.
More recently a more accurate integer linear programming model for DSP mem-
improvements.
Finally, a technique that operates at a higher level than the other methods
allowing the coloring method to be used with each of the back-ends within the
compiler. The problem is modeled as an independence graph and the weights
between variables take account of both execution frequency and how close the two
accesses are in the code.
been proposed in recent years.
3.5
Optimizations for Code Size
Most digital signal processors comprise fast, but small on-chip memories that
store both data and the program code. While it is possible to provide additional,
external memory this may not be desirable for reasons of cost and higher PCB
integration. In such a situation the size of available on-chip memories place hard
constraints on the code size which as an optimization goal becomes at least as
important as performance. Incidentally, smaller code may also be faster code,
especially if an instruction cache is present. Lower instruction count and a reduced
number of instruction cache misses contribute to higher performance. However,
there is no strict correlation between code size and performance. For example,
code size whereas more code-size aware code optimization such as redundant code
elimination may lead to
lower
performance. Eventually, it will be the responsibility
of the application design team to trade-off the (real-time) performance requirements
of their application and the memory constraints set by their chosen processor. In
the following paragraph we present a number of compiler-driven optimizations
for code size that are applicable to most DSPs and do not require any additional
hardware modules e.g. for code decompression. A comprehensive survey of code-
3.5.1
Generic Optimizations for Code Compaction
In this paragraph we discuss a number of code optimizations that are routinely
applied by most compilers as part of their effort to eliminate code redundancies.