10.96 #pragma Otime

This pragma optimizes all subsequent functions for speed, performing optimizations to reduce execution time at the expense of a possible increase in image size.

Usage

To optimize all subsequent functions for execution time, use #pragma Otime. For example, when compiling with armcc -Ospace (the default):

void function1(void){
    ...                // Optimized for code size (from armcc -Ospace)
}

#pragma Otime
void function2(void){
    ...                // Optimized for execution time
}

void function3(void){
    ...                // Optimized for execution time
}

To optimize an individual function for execution time, use #pragma Otime together with #pragma push and #pragma pop. For example, when compiling with armcc -Ospace (the default):

void function1(void){
    ...                 // Optimized for code size (from armcc -Ospace)
}
#pragma push
#pragma Otime
void function2(void){
    ...                 // Optimized for execution time
}
#pragma pop

void function3(void){
    ...                 // Optimized for code size (from armcc -Ospace)
}

Restriction

The pragma must be placed outside a function.

Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.