HyFM: function merging for free
HyFM: function merging for free
复制标题
HyFM:免费功能合并
DOI:
10.1145/3461648.3463852
复制
发表时间:
2021
期刊:
影响因子:
--
通讯作者:
Rocha R
中科院分区:
文献类型:
--
作者:
Rocha R
Function merging is an important optimization for reducing code size. It merges multiple functions into a single one, eliminating duplicate code among them. The existing state-of-the-art relies on a well-known sequence alignment algorithm to identify duplicate code across whole functions. However, this algorithm is quadratic in time and space on the number of instructions. This leads to very high time overheads and prohibitive levels of memory usage even for medium-sized benchmarks. For larger programs, it becomes impractical.This is made worse by an overly eager merging approach. All selected pairs of functions will be merged. Only then will this approach estimate the potential benefit from merging and decide whether to replace the original functions with the merged one. Given that most pairs are unprofitable, a significant amount of time is wasted producing merged functions that are simply thrown away.In this paper, we propose HyFM, a novel function merging technique that delivers similar levels of code size reduction for significantly lower time overhead and memory usage. Unlike the state-of-the-art, our alignment strategy works at the block level. Since basic blocks are usually much shorter than functions, even a quadratic alignment is acceptable. However, we also propose a linear algorithm for aligning blocks of the same size at a much lower cost. We extend this strategy with a multi-tier profitability analysis that bails out early from unprofitable merging attempts. By aligning individual pairs of blocks, we are able to decide their alignment’s profitability separately and before actually generating code.Experimental results on SPEC 2006 and 2017 show that HyFM needs orders of magnitude less memory, using up to 48 MB or 5.6 MB, depending on the variant used, while the state-of-the-art requires 32 GB in the worst case. HyFM also runs over 4.5×× faster, while still achieving comparable code size reduction. Combined with the speedup of later compilation stages due to the reduced number of functions, HyFM contributes to a reduced end-to-end compilation time.
登录
查看更多内容
DOI:
10.5555/3314872.3314892
发表时间:
2019-02
期刊:
2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)
影响因子:
--
作者:
Rodrigo C. O. Rocha;Pavlos Petoumenos;Zheng Wang;M. Cole;Hugh Leather
通讯作者:
Rodrigo C. O. Rocha;Pavlos Petoumenos;Zheng Wang;M. Cole;Hugh Leather
DOI:
--
发表时间:
2017
期刊:
IEEE/ACM International Symposium on Code Generation and Optimization
影响因子:
--
作者:
Teresa L. Johnson;M. Amini;D. Li
通讯作者:
D. Li
DOI:
--
发表时间:
2019
期刊:
IEEE/ACM International Symposium on Code Generation and Optimization
影响因子:
--
作者:
Vasileios Porpodas;Rodrigo C. O. Rocha;E. Brevnov;L. F. Góes;T. Mattson
通讯作者:
T. Mattson
DOI:
--
发表时间:
2004
期刊:
影响因子:
--
作者:
Gábor Lóki;Ákos Kiss;J. Jász;Árpád Beszédes
通讯作者:
Árpád Beszédes
DOI:
--
发表时间:
2018
期刊:
IEEE/ACM International Symposium on Code Generation and Optimization
影响因子:
--
作者:
Vasileios Porpodas;Rodrigo C. O. Rocha;L. F. Góes
通讯作者:
L. F. Góes