摘要
Calling context is crucial for improving the precision of program analyses in various use cases (clients), such as profiling, debugging, optimization, and security checking. Often the calling context is encoded using a numerical value. We have observed that many clients benefit not only from a deterministic but also globally distinguishable value across runs to simplify bookkeeping and guarantee complete uniqueness. However, existing work only guarantees determinism, not global distinguishability. Clients need to develop auxiliary helpers, which incurs considerable overhead to distinguish encoded values among all calling contexts. In this paper, we propose Deterministic Distinguishable Calling Context Encoding () that can enable both properties of calling context encoding natively. The key idea of is leveraging the static call graph and encoding each calling context as the running call path count. Thereby, a mapping is established statically and can be readily used by the clients. Our experiments with two client tools show that has a comparable overhead compared to two state-of-the-art encoding schemes, PCCE and PCC, and further avoids the expensive overheads of collision detection, up to 2.1× and 50%, for Splash-3 and SPEC CPU 2017, respectively.
摘要译文
调用上下文对于提高各种用例(客户端)中程序分析的精度至关重要,例如分析、调试、优化和安全检查。 通常使用数值对调用上下文进行编码。 我们已经观察到,许多客户不仅受益于确定性价值,而且还受益于跨运行的全球可区分价值,以简化簿记并保证完全唯一性。 然而,现有的工作只保证决定论,不能保证全局可区分性。 客户端需要开发辅助助手,这会带来相当大的开销来区分所有调用上下文中的编码值。 在本文中,我们提出了确定性可区分的调用上下文编码(),它可以本地启用调用上下文编码的两个属性。 的关键思想是利用静态调用图,并将每个调用上下文编码为运行调用路径计数。 由此,静态地建立映射,并且可以被客户端容易地使用。 我们使用两个客户端工具进行的实验表明,与两种最先进的编码方案PCCE和PCC相比,它具有相当的开销,并进一步避免了昂贵的冲突检测开销,Splash-3和SPEC CPU 2017分别高达2.1倍和50%。
Sungkeun Kim[1];Khanh Nguyen[2];Chia-Che Tsai[2];Jaewoo Lee[2];Abdullah Muzahid[2];Eun Jung Kim[2]. Enhancing Program Analysis with Deterministic Distinguishable Calling Context[C]//CC '25: Proceedings of the 34th ACM SIGPLAN International Conference on Compiler Construction, Las Vegas NV USA, March 1 - 2, 2025, US: ACM, 2025: 1 - 12