OPTIMIZATIONS
Function
-Oilib[=<arguments>]
<arguments> are one or several of the following suboptions:
b: inline calls to strlen()
d: inline calls to fabs() or fabsf()
e: inline calls to memset()
f: inline calls to memcpy()
g: replace shifts left of 1 by array lookup
None
None
None
This option enables the compiler to optimize specific known library functions to reduce execution time. The Compiler frequently uses small functions such as strcpy(), strcmp(), and so forth. The following functions are optimized:
memset() is optimized only if:
The following code optimizes memset ()
(void)memset(&buf, 0, 50);
In this case, _memset_clear_8bitCount, present in the ANSI library (string.c), replaces the call to memset().
memcpy() is optimized only if:
The following code optimizes memcpy ()
(void)memcpy(&buf, &buf2, 30);
In this case, _memcpy_8bitCount, present in the ANSI library (string.c), replaces the call to memcpy().
_PowOfTwo_8[val] replaces (char)1 << val if _PowOfTwo_8 is known at compile time. Similarly, for 16-bit and for 32-bit shifts, the arrays _PowOfTwo_16 and _PowOfTwo_32 are used. These constant arrays contain the values 1, 2, 4, 8.... They are declared in hidef.h. The compiler performs this optimization only when optimizing for time.
Using-Oilib without arguments optimizes calls to all supported library functions.
The example code below compiles the function f with the -Oilib=a option (only available for ICG-based backends)
void f(void) {
char *s = strcpy(s, ct);
}
This translates in a similar fashion to the following function:
void g(void) {
s2 = s;
while(*s2++ = *ct++);
}
-Oi: Inlining
Message C5920