English
Language : 

AN3350 Datasheet, PDF (107/185 Pages) STMicroelectronics – eTPU compiler tools
AN3350
Intermediate optimizations
13.1.5
Dead store elimination
Dead store elimination removes unused assignment statements. This optimization reduces
size and improves speed.
Table 21 explains how to control the optimization for dead store elimination.
Table 21. Controlling dead store elimination
Turn control this option from here...
use this setting
source code
#pragma opt_dead_assignments on | off | reset
command line
-opt [no]deadstore
For example, in Example 57 the variable x is first assigned the value of y * y. However,
this result is not used before x is assigned the result returned by a call to getresult().
In Example 58 the compiler can safely remove the first assignment to x since the result of
this assignment is never used.
Example 57 Before dead store elimination
void func_from(int x, int y)
{
x = y * y;
otherfunc1(y);
x = getresult();
otherfunc2(y);
}
Example 58 After dead store elimination
void func_to(int x, int y)
{
otherfunc1(y);
x = getresult();
otherfunc2(y);
}
13.1.6
Live range splitting
Live range splitting attempts to reduce the number of variables used in a function. This
optimization reduces a function’s runtime stack size, requiring fewer instructions to invoke
the function. This optimization potentially improves execution speed.
Table 22 explains how to control the optimization for live range splitting.
Table 22. Controlling live range splitting
Turn control this option from here...
use this setting
Source code
There is no pragma to control this optimization.
Command line
-opt level=3, -opt level=4
Doc ID 018512 Rev 2
107/185