filmov
tv
Code Size Compiler Optimizations and Techniques for Embedded Systems - Aditya Kumar - CppCon 2021
![preview_player](https://i.ytimg.com/vi/JOBs3l1jAkw/maxresdefault.jpg)
Показать описание
---
Code size of embedded application has been a concern for a very long time. While storage becomes cheaper and smaller, developers find creative ways to increase code size by adding features or unnecessary software engineering. Compilers have come a long way in optimizing applications for code size. While most compiler optimization work were focused on application performance, we have seen increase in the code size optimizations in recent years.
In this presentation I'll talk about classical as well as recent compiler optimizations for code size, a few of which I implemented in the LLVM compiler. Some optimizations (hot cold splitting, function entry instrumentation) require collecting data from the field while the application is running. I'll provide an overview of how those compiler techniques help reduce code size. I'll also talk about some tips and techniques (compiler flags to reduce code size, tuning of compiler options like inline threshold), that help reduce binary size. Having knowledge of the code generated by the compiler and the instruction set architecture can help engineers chose appropriate programming abstractions and idioms.
Key takeaways:
- Compiler optimization flags and tunings for code size optimizations
- Selecting code-size friendly data structures and algorithms from the C++ standard library
- Source code level optimization and annotation techniques to reduce binary size
- Compiler instrumentation techniques to get insights into the source code
- Software re-organization techniques to reduce working set during program startup
---
Aditya Kumar
I've been working on LLVM since 2012. I've contributed to modern compiler optimizations like GVNHoist, Hot Cold Splitting, Hexagon specific optimizations, clang static analyzer, libcxx, libstdc++, and graphite framework of gcc.
---
Code size of embedded application has been a concern for a very long time. While storage becomes cheaper and smaller, developers find creative ways to increase code size by adding features or unnecessary software engineering. Compilers have come a long way in optimizing applications for code size. While most compiler optimization work were focused on application performance, we have seen increase in the code size optimizations in recent years.
In this presentation I'll talk about classical as well as recent compiler optimizations for code size, a few of which I implemented in the LLVM compiler. Some optimizations (hot cold splitting, function entry instrumentation) require collecting data from the field while the application is running. I'll provide an overview of how those compiler techniques help reduce code size. I'll also talk about some tips and techniques (compiler flags to reduce code size, tuning of compiler options like inline threshold), that help reduce binary size. Having knowledge of the code generated by the compiler and the instruction set architecture can help engineers chose appropriate programming abstractions and idioms.
Key takeaways:
- Compiler optimization flags and tunings for code size optimizations
- Selecting code-size friendly data structures and algorithms from the C++ standard library
- Source code level optimization and annotation techniques to reduce binary size
- Compiler instrumentation techniques to get insights into the source code
- Software re-organization techniques to reduce working set during program startup
---
Aditya Kumar
I've been working on LLVM since 2012. I've contributed to modern compiler optimizations like GVNHoist, Hot Cold Splitting, Hexagon specific optimizations, clang static analyzer, libcxx, libstdc++, and graphite framework of gcc.
---
Комментарии