Pattern-Based Peephole Optimizations with Java JIT Tests

Pattern-Based Peephole Optimizations with Java JIT Tests
复制标题

DOI:
10.1145/3597926.3598038
复制
发表时间:
2023-07
期刊:
Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis
影响因子:
--
通讯作者:
Zhiqiang Zang;Aditya Thimmaiah;Miloš Gligorić
Zhiqiang Zang;Aditya Thimmaiah;Miloš Gligorić
中科院分区:
其他
文献类型:
--
作者:
Zhiqiang Zang;Aditya Thimmaiah;Miloš Gligorić

文献摘要

相似文献

我们提出JOG,一个框架,促进开发Java JIT窥视孔优化与JIT测试。JOG使开发人员能够用Java本身编写一个模式,通过在优化之前和之后编写代码以及任何必要的先决条件来指定所需的代码转换。这样的模式可以以与OpenJDK中已经编写的优化测试相同的方式编写。JOG将每个模式转换为C/C++代码,可以集成为JIT优化通道。JOG还可以从模式中生成优化的Java测试。此外,JOG可以自动检测一对优化之间可能的阴影关系,其中被阴影的优化的效果被另一个覆盖。我们的评估表明,JOG可以更容易地编写可读的JIT优化和测试,而不会降低JIT优化的有效性。我们编写了162个模式,包括OpenJDK中的68个现有优化,92个改编自LLVM的新优化,以及我们提出的两个新优化。我们为OpenJDK打开了8个拉取请求(PR),其中6个用于新优化,1个用于删除隐藏优化,1个用于新生成的JIT测试; 7个PR已经集成到OpenJDK的主分支中。
We present JOG, a framework that facilitates developing Java JIT peephole optimizations alongside JIT tests. JOG enables developers to write a pattern, in Java itself, that specifies desired code transformations by writing code before and after the optimization, as well as any necessary preconditions. Such patterns can be written in the same way that tests of the optimization are already written in OpenJDK. JOG translates each pattern into C/C++ code that can be integrated as a JIT optimization pass. JOG also generates Java tests for optimizations from patterns. Furthermore, JOG can automatically detect possible shadow relation between a pair of optimizations where the effect of the shadowed optimization is overridden by another. Our evaluation shows that JOG makes it easier to write readable JIT optimizations alongside tests without decreasing the effectiveness of JIT optimizations. We wrote 162 patterns, including 68 existing optimizations in OpenJDK, 92 new optimizations adapted from LLVM, and two new optimizations that we proposed. We opened eight pull requests (PRs) for OpenJDK, including six for new optimizations, one on removing shadowed optimizations, and one for newly generated JIT tests; seven PRs have already been integrated into the master branch of OpenJDK.