SDAA552 September   2026 MSPM0C1103 , MSPM0C1103-Q1 , MSPM0C1104 , MSPM0C1104-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2C Compiler Optimization
    1. 2.1 Optimization Settings
      1. 2.1.1 Optimization Level
      2. 2.1.2 Optnone
      3. 2.1.3 Link Time Optimization – LTO
    2. 2.2 Runtime Model Options
      1. 2.2.1 Data and Function Sections
      2. 2.2.2 Function Outlining
  6. 3Coding Techniques
    1. 3.1 Use Smallest Possible Types for Variables and Constants
    2. 3.2 Avoid Multiply and Divide
    3. 3.3 Use Lookup Tables Instead of Manual Calculation
    4. 3.4 Use Functions Effectively
    5. 3.5 Implement Down Counting Loops
    6. 3.6 Use the __even_in_range() Intrinsic
    7. 3.7 volatile Keyword
  7. 4Example
    1. 4.1 Optimization Level
    2. 4.2 LTO
    3. 4.3 Runtime Model Options
  8. 5Summary
  9. 6References

Function Outlining

Function Outlining (aka Machine Outlining) is an optimization that identifies recurring sequences of machine code and replaces each instance with a call to a new function containing those operations. Function Outlining is enabled when the -Oz option is selected.

Table 2-3 Function Outlining
Function Outlining Option Effect
-moutline Performs machine outlining within functions; only applied when it is guaranteed that it will reduce the net code size.
-moutline-inter-function More aggressive function outlining but does not always guarantee an overall code size reduction. Can be specified in combination with the -Oz option to enable inter-function outlining.
-mno-outline Disables function outlining for a given compilation unit when using the -Oz option.