首页> 外文期刊>ACM Transactions on Parallel Computing >Tapir: Embedding Recursive Fork-join Parallelism into LLVM's Intermediate Representation
【24h】

Tapir: Embedding Recursive Fork-join Parallelism into LLVM's Intermediate Representation

机译:Tapir:将递归Fork-join并行性嵌入LLVM的中间表示中

获取原文
获取原文并翻译 | 示例

摘要

Tapir (pronounced TAY-per) is a compiler intermediate representation (IR) that embeds recursive fork-join parallelism, as supported by task-parallel programming platforms such as Cilk and OpenMP, into a mainstream compiler's IR. Mainstream compilers typically treat parallel linguistic constructs as syntactic sugar for function calls into a parallel runtime. These calls prevent the compiler from performing optimizations on and across parallel control constructs. Remedying this situation has generally been thought to require an extensive reworking of compiler analyses and code transformations to handle parallel semantics. Tapir leverages the "serial-projection property," which is commonly satisfied by task-parallel programs, to handle the semantics of these programs without an extensive rework of the compiler. For recursive fork-join programs that satisfy the serial-projection property, Tapir enables effective compiler optimization of parallel programs with only minor changes to existing compiler analyses and code transformations. Tapir uses the serial-projection property to order logically parallel fine-grained tasks in the program's control-flow graph. This ordered representation of parallel tasks allows the compiler to optimize parallel codes effectively with only minor modifications. For example, to implement Tapir/LLVM, a prototype of Tapir in the LLVM compiler, we added or modified less than 3,000 lines of LLVM's half-million-line core middle-end functionality. These changes sufficed to enable LLVM's existing compiler optimizations for serial code—including loop-invariant-code motion, common-subexpression elimination, and tail-recursion elimination—to work with parallel control constructs such as parallel loops and Cilk's cilk_spawn keyword. Tapir also supports parallel optimizations, such as loop scheduling, which restructure the parallel control flow of the program. By making use of existing LLVM optimizations and new parallel optimizations, Tapir/LLVM can optimize recursive fork-join programs more effectively than traditional compilation methods. On a suite of 35 Cilk application benchmarks, Tapir/LLVM produces more efficient executables for 30 benchmarks, with faster 18-core running times for 26 of them, compared to a nearly identical compiler that compiles parallel linguistic constructs the traditional way.
机译:Tapir(发音为TAY-per)是一种编译器中间表示(IR),它把递归派生联合并行性(由Cilk和OpenMP等任务并行编程平台支持)嵌入到主流编译器的IR中。主流编译器通常将并行语言结构视为语法函数,用于对并行运行时的函数调用。这些调用使编译器无法对并行控制结构进行优化。通常认为,要纠正这种情况,需要对编译器分析和代码转换进行大量修改,以处理并行语义。 Tapir利用“并行投影属性”(通常由任务并行程序满足)来处理这些程序的语义,而无需大量修改编译器。对于满足serial-projection属性的递归fork-join程序,Tapir只需对现有编译器分析和代码转换进行很小的更改就可以对并行程序进行有效的编译器优化。 Tapir使用serial-projection属性在程序的控制流图中对逻辑并行的细粒度任务进行排序。并行任务的这种有序表示允许编译器仅进行少量修改就可以有效地优化并行代码。例如,为了实现LLVM编译器中Tapir的原型Tapir / LLVM,我们添加或修改了LLVM的50万行核心中端功能的少于3,000行。这些更改足以使LLVM现有的串行代码编译器优化(包括循环不变代码运动,消除公共子表达式和消除尾递归)能够与并行控制结构(例如并行循环和Cilk的cilk_spawn关键字)一起使用。 Tapir还支持并行优化,例如循环调度,它可以重组程序的并行控制流程。通过使用现有的LLVM优化和新的并行优化,Tapir / LLVM可以比传统的编译方法更有效地优化递归fork-join程序。与一组几乎相同的以传统方式编译并行语言结构的编译器相比,在包含35个Cilk应用程序基准的套件中,Tapir / LLVM可以为30个基准生成更有效的可执行文件,其中26个基准可以更快地运行18核。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号