The road not taken: exploring alias analysis based optimizations missed by the compiler

Author:

Chitre Khushboo1ORCID,Kedia Piyus1ORCID,Purandare Rahul2ORCID

Affiliation:

1. IIIT Delhi, India

2. IIIT Delhi, India / University of Nebraska-Lincoln, USA

Abstract

Context-sensitive inter-procedural alias analyses are more precise than intra-procedural alias analyses. However, context-sensitive inter-procedural alias analyses are not scalable. As a consequence, most of the production compilers sacrifice precision for scalability and implement intra-procedural alias analysis. The alias analysis is used by many compiler optimizations, including loop transformations. Due to the imprecision of alias analysis, the program’s performance may suffer, especially in the presence of loops. Previous work proposed a general approach based on code-versioning with dynamic checks to disambiguate pointers at runtime. However, the overhead of dynamic checks in this approach is O(log n), which is substantially high to enable interesting optimizations. Other suggested approaches, e.g., polyhedral and symbolic range analysis, have O(1) overheads, but they only work for loops with certain constraints. The production compilers, such as LLVM and GCC, use scalar evolution analysis to compute an O(1) range check for loops to resolve memory dependencies at runtime. However, this approach also can only be applied to loops with certain constraints. In this work, we present our tool, Scout, that can disambiguate two pointers at runtime using single memory access. Scout is based on the key idea to constrain the allocation size and alignment during memory allocations. Scout can also disambiguate array accesses within a loop for which the existing O(1) range checks technique cannot be applied. In addition, Scout uses feedback from static optimizations to reduce the number of dynamic checks needed for optimizations. Our technique enabled new opportunities for loop-invariant code motion, dead store elimination, loop vectorization, and load elimination in an already optimized code. Our performance improvements are up to 51.11% for Polybench and up to 0.89% for CPU SPEC 2017 suites. The geometric means for our allocator’s CPU and memory overheads for CPU SPEC 2017 benchmarks are 1.05%, and 7.47%, respectively. For Polybench benchmarks, the geometric mean of CPU and memory overheads are 0.21% and 0.13%, respectively.

Funder

TCS Foundation

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference48 articles.

1. 2016 (accessed Apr 14 2022). Intel 64 and ia-32 architectures software developer’s manual volume 2b. https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2b-manual.pdf 2016 (accessed Apr 14 2022). Intel 64 and ia-32 architectures software developer’s manual volume 2b. https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2b-manual.pdf

2. 2019 (accessed Apr 13 2022). Restrict Keyword in LLVM. https://lists.llvm.org/pipermail/llvm-dev/2019-March/131127.html 2019 (accessed Apr 13 2022). Restrict Keyword in LLVM. https://lists.llvm.org/pipermail/llvm-dev/2019-March/131127.html

3. 2021 (accessed Apr 13 , 2022 ). CPU SPEC 2017 benchmark suite. https://www.spec.org/cpu2017/Docs/overview.html##benchmarks 2021 (accessed Apr 13, 2022). CPU SPEC 2017 benchmark suite. https://www.spec.org/cpu2017/Docs/overview.html##benchmarks

4. 2022 (accessed Apr 13 2022). Intrinsic Functions. https://llvm.org/docs/LangRef.html##intrinsic-functions 2022 (accessed Apr 13 2022). Intrinsic Functions. https://llvm.org/docs/LangRef.html##intrinsic-functions

5. 2022 (accessed Apr 13 2022). Runtime Checks of Pointers. https://llvm.org/docs/Vectorizers.html##runtime-checks-of-pointers 2022 (accessed Apr 13 2022). Runtime Checks of Pointers. https://llvm.org/docs/Vectorizers.html##runtime-checks-of-pointers

Cited by 6 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Refined Input, Degraded Output: The Counterintuitive World of Compiler Behavior;Proceedings of the ACM on Programming Languages;2024-06-20

2. 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

3. Reorder Pointer Flow in Sound Concurrency Bug Prediction;Proceedings of the IEEE/ACM 46th International Conference on Software Engineering;2024-02-06

4. Detection of Optimizations Missed by the Compiler;Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2023-11-30

5. Rapid: Region-Based Pointer Disambiguation;Proceedings of the ACM on Programming Languages;2023-10-16

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3