-OiLib: Optimize Library Functions

Group

OPTIMIZATIONS

Scope

Function

Syntax
-OiLib[=<arguments>] 
Arguments

<arguments> are one or multiple of following suboptions:

b: inline calls to the strlen() function

d: inline calls to the fabs() or fabsf() functions

e: inline calls to the memset() function

f: inline calls to the memcpy() function

g: replace shifts left of 1 by array lookup

Default

None

Defines

None

Pragmas

None

Description

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:

Example

Compiling the f() function with the -Oilib=a compiler 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++); 
} 
See also

-Oi: Inlining