6.1.9.40.13 Optim Flag

The optim psect flag is used to indicate the optimizations that can be performed on the psect’s content, provided such optimizations are permitted and have been enabled.

The optimizations are indicated by a colon-separated list of names, shown in the Table 6-11 table. An empty list implies that no optimizations can be performed on the psect.

Table 6-11. Optim Flag Names
NameOptimization
inlineAllow the psect content to be inlined.
jumpPerform jump-based optimizations.
mergeAllow the psect’s content to be merged with that of other similar psects (PIC10/12/16 devices only).
paPerform proceedural abstraction.
peepPerform peephole optimizations.
removeAllow the psect to be removed entirely if it is completely inlined.
splitAllow the psect to be split into smaller psects if it surpasses size restrictions (PIC10/12/16 devices only).
emptyPerform no optimization on this psect.

So, for example, the psect definition:

PSECT myText,class=CODE,reloc=2,optim=inline:jump:split

allows the assembler optimizer to perform inlining, splitting and jump-type optimizations of the myText psect content if those optimizations are enabled. The definition:

PSECT myText,class=CODE,reloc=2,optim=

disables all optimizations associated with this psect regardless of the optimizer setting.

The optim psect flag replaces the use of the separate psect flags: merge, split, inline and keep.