Affiliation:
1. Stanford University, USA
2. Federal University of Minas Gerais, Brazil
Abstract
Academia has spent much effort into making context-sensitive
analyses
practical, with great profit. However, the implementation of context-sensitive
optimizations
, in contrast to analyses, is still not practical, due to code-size explosion. This growth happens because current technology requires the cloning of full paths in the Calling Context Tree. In this paper, we present a solution to this problem. We combine finite state machines and dynamic dispatching to allow fully context-sensitive specialization while cloning only functions that are effectively optimized. This technique makes it possible to apply very liberal optimizations, such as context-sensitive constant propagation, in large programs—something that could not have been easily done before. We demonstrate the viability of our idea by formalizing it in Prolog, and implementing it in LLVM. As a proof of concept, we have used our state machines to implement context-sensitive constant propagation in LLVM. The binaries produced by traditional full cloning are 2.63 times larger than the binaries that we generate with our state machines. When applied on Mozilla Firefox, our optimization increases binary size from 7.2MB to 9.2MB. Full cloning, in contrast, yields a binary of 34MB.
Funder
Conselho Nacional de Desenvolvimento Científico e Tecnológico
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference75 articles.
1. Runtime Pointer Disambiguation. In OOPSLA. ACM, New York;Alves Péricles;NY, USA,2015
2. k-Calling Context Profiling. In OOPSLA. ACM, New York;Ausiello Giorgio;NY, USA,2012
3. Eficient Path Profiling;Ball Thomas;MICRO. IEEE Computer Society, USA,1996
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Combining Structured Static Code Information and Dynamic Symbolic Traces for Software Vulnerability Prediction;Proceedings of the IEEE/ACM 46th International Conference on Software Engineering;2024-04-12
2. Jasmine: A Static Analysis Framework for Spring Core Technologies;Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering;2022-10-10
3. Inlining for Code Size Reduction;25th Brazilian Symposium on Programming Languages;2021-09-27
4. Contextual dispatch for function specialization;Proceedings of the ACM on Programming Languages;2020-11-13