paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Trimmer: Context-Specific Code Reduction

Trimmer:面向特定上下文的代码缩减
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 3/10 · 该论文属于静态程序分析与编译优化,使用上下文敏感常量传播和抽象解释进行代码缩减,但未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户画像的核心交叉方向不直接匹配。引用 3 inbox
Aatira Anum Ahmad, Mubashir Anwar, Hashim Sharif, Ashish Gehani, Fareed Zaffar
crossref: 2026-09-12

AI 速览

一句话:通过开发者提供的常量输入特化程序并删除未使用特性,从而缩减代码体积。

Trimmer 是一个代码体积缩减工具,核心思想是利用开发者提供的常量输入(命令行选项或配置文件)对程序进行特化。这些常量决定特定部署中需要保留的特性,进而可删除未使用特性。Trimmer 包含面向输入特化的编译器变换,支持精确而高效的上下文敏感过程间常量传播,并引入自定义循环展开器。工具易用且高度参数化,开发者可显式权衡分析精度与特化时间。论文还概述了 Trimmer 的静态分析遍。源码与演示视频已公开。

问题
如何在不影响特定部署所需功能的前提下缩减程序代码体积,尤其是利用部署相关常量输入去除未使用特性。
方法
通过常量输入特化程序,结合编译器变换、上下文敏感的过程间常量传播和自定义循环展开,并提供参数化配置以权衡分析精度与特化时间。
评估
摘要未报告定量实验,仅说明工具已公开源码和演示视频,并概述静态分析流程及可配置的精度-时间权衡。
原文摘要(Abstract)

We present Trimmer, a state-of-the-art tool for reducing code size. Trimmer reduces code sizes by specializing programs with respect to constant inputs provided by developers. The static data can be provided as command-line options or through configuration files. The constants define the features that must be retained, which in turn determine the features that are unused in a specific deployment (and can therefore be removed). Trimmer includes sophisticated compiler transformations for input specialization, supports precise yet efficient context-sensitive inter-procedural constant propagation, and introduces a custom loop unroller. Trimmer is easy-to-use and extensively parameterized. We discuss how Trimmer can be configured by developers to explicitly trade analysis precision and specialization time. We also provide a high-level description of Trimmer’s static analysis passes. The source code is publicly available at: https://github.com/ashish-gehani/Trimmer. A video demonstration can be found here: https://youtu.be/6pAuJ68INnI.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7258,
  title = {Trimmer: Context-Specific Code Reduction},
  author = {Aatira Anum Ahmad and Mubashir Anwar and Hashim Sharif and Ashish Gehani and Fareed Zaffar},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3559529}
}