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

Tao B. Schardl, William S. Moses, Charles E. Leiserson

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

This paper explores how fork-join parallelism, as supported by concurrency platforms such as Cilk and OpenMP, can be embedded into a compiler's intermediate representation (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 across parallel control constructs. Remedying this situation is generally thought to require an extensive reworking of compiler analyses and code transformations to handle parallel semantics. Tapir is a compiler IR that represents logically parallel tasks asymmetrically in the program's control flow graph. Tapir allows the compiler to optimize across parallel control constructs with only minor changes to its existing analyses and code transformations. To prototype Tapir in the LLVM compiler, for example, we added or modified about 6000 lines of LLVM's 4-million-line codebase. Tapir enables 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 spawning and parallel loops. Tapir also supports parallel optimizations such as loop scheduling.

Original languageEnglish (US)
Title of host publicationPPoPP 2017 - Proceedings of the 22nd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming
PublisherAssociation for Computing Machinery
Pages249-265
Number of pages17
ISBN (Electronic)9781450344937
DOIs
StatePublished - Jan 26 2017
Externally publishedYes
Event22nd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2017 - Austin, United States
Duration: Feb 4 2017Feb 8 2017

Publication series

NameACM SIGPLAN Notices
PublisherAssociation for Computing Machinery
Number8
Volume52
ISSN (Print)1523-2867

Conference

Conference22nd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2017
Country/TerritoryUnited States
CityAustin
Period2/4/172/8/17

Keywords

  • cilk
  • compiling
  • control-flow graph
  • fork-join parallelism
  • llvm
  • multicore
  • openmp
  • optimization
  • par- allel computing
  • serial semantics
  • tapir

ASJC Scopus subject areas

  • General Computer Science

Fingerprint

Dive into the research topics of 'Tapir: Embedding Fork-Join Parallelism into LLVM's Intermediate Representation'. Together they form a unique fingerprint.

Cite this