Skip to main content
QUICK REVIEW

[Paper Review] Automatically Tuning the GCC Compiler to Optimize the Performance of Applications Running on the ARM Cortex-M3.

Craig Blackmore, Oliver Ray|arXiv (Cornell University)|Feb 23, 2017
Parallel Computing and Optimization TechniquesComputer Science5 citations
TL;DR

This paper proposes an automated method to tune GCC compiler flags for the ARM Cortex-M3, achieving performance improvements beyond the standard -O3 optimization by identifying a refined configuration (-Ocm3) that removes 26 flags and adds 3, reducing execution time significantly across the BEEBS benchmark suite.

ABSTRACT

This paper introduces a novel method for automatically tuning the selection of compiler flags in order to optimize the performance of software that is intended to run on particular hardware platforms. Motivated by the rapid recent expansion of so-called Internet of Things (IoT) devices, we are particularly interested in improving the execution time of code running on embedded system architectures. We demonstrate the effectiveness of our approach on code compiled by the GNU C Compiler (GCC) for the ARM Cortex-M3 (CM3) processor; and we show how our method outperforms the current industry standard -O3 optimization level across a diverse embedded system benchmark suite called BEEBS. We begin by conducting an investigatory study to quantify the potential gains by using existing iterative compilation approaches that time-intensively search for optimal configurations for each given benchmark. Then we adapt iterative compilation to output a single configuration that optimizes performance across the entire benchmark suite as a whole. Although this is a time consuming process, our approach eventually constructs a simple variation of -O3, which we call -Ocm3, that realizes nearly two thirds of the known available gains on the CM3 architecture (beyond -O3) and significantly outperforms a far more complex state-of-the-art predictive method. Our approach suggests that 26 flags should be removed from -O3 while three other flags should be added. We analyze in detail two of the former and explain why turning them off improves performance on this processor.

Motivation & Objective

  • To address the challenge of manually selecting optimal compiler flags for embedded systems, especially in resource-constrained IoT devices.
  • To explore whether iterative compilation can identify a single, unified compiler configuration that optimizes performance across a diverse benchmark suite.
  • To outperform existing state-of-the-art predictive methods for compiler tuning on the ARM Cortex-M3 architecture.
  • To identify and analyze specific compiler flags whose removal or addition significantly improves performance on the CM3 processor.

Proposed method

  • The study employs iterative compilation to systematically explore compiler flag configurations and measure their performance impact on the BEEBS benchmark suite.
  • It uses time-intensive search to identify the optimal configuration across all benchmarks, treating the entire suite as a single optimization target.
  • The method generates a derived optimization level, -Ocm3, by removing 26 flags from -O3 and adding 3 new ones based on performance gains.
  • The approach evaluates and compares the final -Ocm3 configuration against both -O3 and a complex predictive tuning method.
  • It conducts detailed analysis on two removed flags to explain their negative performance impact on the CM3 architecture.
  • The final configuration is validated across the full BEEBS suite to measure overall performance improvement.

Experimental results

Research questions

  • RQ1Can iterative compilation identify a single compiler configuration that optimizes performance across a diverse embedded benchmark suite?
  • RQ2How much performance gain can be achieved beyond the standard -O3 optimization level on the ARM Cortex-M3?
  • RQ3Which specific compiler flags, when removed or added, lead to measurable performance improvements on the CM3 architecture?
  • RQ4How does the proposed -Ocm3 configuration compare to state-of-the-art predictive tuning methods in terms of performance and simplicity?
  • RQ5Why do certain compiler flags negatively impact performance on the ARM Cortex-M3, and what are the underlying reasons?

Key findings

  • The proposed -Ocm3 configuration achieves nearly two-thirds of the known maximum performance gain available beyond -O3 on the ARM Cortex-M3.
  • The method outperforms a more complex state-of-the-art predictive tuning approach, despite its simplicity.
  • Removing 26 specific flags from -O3 and adding 3 new ones results in measurable and significant performance improvements.
  • Two of the removed flags were found to degrade performance due to increased instruction-level parallelism overhead on the CM3's pipeline.
  • The final configuration reduces execution time across the BEEBS benchmark suite more effectively than -O3, demonstrating the value of holistic, suite-wide tuning.
  • The study confirms that architecture-specific tuning can yield substantial gains even beyond the highest standard optimization level.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.