Research on an optimization method for region-level similar code merging
On devices with limited memory and processing power (e.g., embedded systems, IoT devices), code size is crucial, which not only concerns the execution efficiency of the program but also directly affects the system's resource consumption. In current mainstream compilers, the commonly used code size optimization is mainly achieved by reducing redundant code, failing to fully use the optimization opportunities of similar code in conditional branches. To address this problem, this paper proposes a region-level similar code merging method, which is implemented in the form of Pass in LLVM compiler. It can identify and merge similar code regions in conditional branches to further reduce the code size. The method in this paper is experimented on MiBench and SPEC CPU 2006 test sets, and achieves an average of 543 bytes and a maximum of 2464 bytes code size reduction. The experimental results show that the method in this paper can effectively merge similar code and further reduce the code size.
Authors
- Kai Nie (ORCID: https://orcid.org/0000-0001-7568-4628)
- Chenbo Zhao (ORCID: https://orcid.org/0000-0001-9476-7787)
- Tao Xie (ORCID: https://orcid.org/0000-0002-4179-2898)
- Zixiao Wu (ORCID: https://orcid.org/0000-0001-6897-0976)
- Han Lin (ORCID: https://orcid.org/0000-0002-1303-8636)
Institutions
- National Center for Supercomputing Applications (BG)
- Zhengzhou University (CN)
- National Supercomputing Center in Wuxi (CN)
Publication Details
- Journal
- IET conference proceedings.
- Published
- 2025-10-13
- DOI
- https://doi.org/10.1049/icp.2025.2876
- Primary Topic
- Distributed and Parallel Computing Systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00