GCC编译优化选项关系的分析应用
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP314

基金项目:

国家重点研发计划(2022YFB4501802); 北京市自然科学基金-小米创新联合基金(L243010); 酱酒行业数字化转型联合实验室


Analysis and Application of Relationships Among GCC Compiler Optimization Options
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    编译优化选项作为编译器与开发者之间的核心交互接口, 其合理配置直接影响软件质量与开发效率. 然而, 编译选项的数量庞大且关系复杂, 优化效果同时受到程序特征和机器架构的动态影响, 官方文档难以满足实际应用场景的配置指导需求. 针对上述挑战, 结合静态和动态分析技术, 基于GCC编译器源码深入探讨影响编译器选项效果的两类关系: 内部约束关系和外部环境依赖关系. 首先基于静态分析识别出选项间68对内部约束关系(涉及84个选项)以及103对外部环境依赖关系(包括51个机器架构敏感选项与52个程序特征敏感选项), 并进一步基于动态分析技术验证选项在不同外部环境下的有效性. 然后, 将选项关系的分析结果应用于3个编译相关技术场景: 1)提高选项自动调优效率, 设计基于选项关系感知的遗传调优算法, 相较于不考虑选项关系的其他算法(如遗传算法), 性能平均提升3.65%; 2)提高编译器测试效率, 设计基于选项关系的测试序列生成方法, 生成效率相较于随机方法提升了51.7%; 3)为开发者提供更有效的选项配置方案, 帮助其合理使用选项以达到预期优化目标. 通过这3个应用, 表明编译选项关系在自动调优、编译器测试及实际配置中具有关键作用.

    Abstract:

    Compiler optimization options serve as a core interface between the compiler and developers, and their proper configuration directly impacts software quality and development efficiency. However, there are a large number of options with complex interrelations, and their optimization effects are dynamically influenced by program features and target machines. The official documentation is also insufficient to provide the configuration guidance needed for practical application scenarios. To address these challenges, this study combines static and dynamic analysis techniques applied to the GCC source code and investigates two types of relationships that affect the effectiveness of compiler options: internal constraint relationships and external environment dependencies. First, 68 pairs of internal constraint relationships (involving 84 options) and 103 pairs of external environment dependencies (including 51 architecture-sensitive options and 52 program feature-sensitive options) are identified through static analysis, and the effectiveness of these options in different external environments is further validated through dynamic analysis. Finally, the analysis results of option relationships are applied to three compiler-related scenarios: 1) improving the effectiveness of compiler auto-tuning by designing a relationship-aware genetic auto-tuning algorithm, which achieves an average performance improvement of 3.65% compared with algorithms that do not consider option relationships, such as the genetic algorithm; 2) improving the effectiveness of compiler testing by proposing a option sequence test case generation method based on option relationships, achieving a 51.7% increase in generation efficiency compared to random methods; 3) providing developers with more effective option configuration schemes to help them use options properly to achieve their desired optimization goals. These three applications demonstrate the key role of compiler option relationships in compiler auto-tuning, compiler testing, and practical configuration.

    参考文献
    相似文献
    引证文献
引用本文

高秉玉,姚梦雨,王子铭,李锭,陈向群,郭耀. GCC编译优化选项关系的分析应用.软件学报,,():1-22

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2025-03-10
  • 最后修改日期:2025-10-14
  • 录用日期:
  • 在线发布日期: 2026-05-13
  • 出版日期:
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号