迭代指针:实现基于循环的指针的静态分析
Iterating Pointers: Enabling Static Analysis for Loop-based Pointers
AI总结:
针对C语言指针直接内存访问难以追踪和优化的问题,提出将指针拆分为数据容器与偏移量的静态分析方法,成功优化OpenSSL等代码并实现自动并行化,最高提升11倍速度。
摘要:
指针是C语言及其他编程语言不可或缺的组成部分。它们从程序员的角度提供了极大的灵活性,允许用户对数据访问模式进行精细且直接的掌控。然而,通过指针进行的访问往往难以追踪,并且对优化器、编译器甚至有时对开发者自身而言都极具挑战性,因为它们提供了直接的内存访问。我们通过向分析器和编译器暴露额外信息来缓解这一问题。通过将指针的概念拆分为数据容器和偏移量,我们能够超越其他最先进方法的优化能力对C程序进行优化,在某些情况下甚至能实现自动并行化。利用这一过程,我们成功分析并优化了来自OpenSSL、Mantevo基准测试套件以及Lempel-Ziv-Oberhumer压缩算法的代码。我们提供了唯一一种自动方法,能够找到Mantevo套件中HPCCG基准测试里开发者所识别出的所有并行化机会,甚至比参考实现高出18%的性能,同时将OpenSSL中PBKDF2算法的实现速度提升了11倍。
英文摘要:
Pointers are an integral part of C and other programming languages. They enable substantial flexibility from the programmer's standpoint, allowing the user fine, unmediated control over data access patterns. However, accesses done through pointers are often hard to track, and challenging to understand for optimizers, compilers, and sometimes, even for the developers themselves because of the direct memory access they provide. We alleviate this problem by exposing additional information to analyzers and compilers. By separating the concept of a pointer into a data container and an offset, we can optimize C programs beyond what other state-of-the-art approaches are capable of, in some cases even enabling auto-parallelization. Using this process, we are able to successfully analyze and optimize code from OpenSSL, the Mantevo benchmark suite, and the Lempel-Ziv-Oberhumer compression algorithm. We provide the only automatic approach able to find all parallelization opportunities in the HPCCG benchmark from the Mantevo suite the developers identified and even outperform the reference implementation by up to 18%, as well as speed up the PBKDF2 algorithm implementation from OpenSSL by up to 11x.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。