Type-safe Runtime Code Generation: Accelerate to LLVM

被引:9
|
作者
McDonell, Trevor L. [1 ]
Chakravarty, Manuel M. T. [2 ]
Grover, Vinod [3 ]
Newton, Ryan R. [1 ]
机构
[1] Indiana Univ, Bloomington, IN 47405 USA
[2] Univ New S Wales, Sydney, NSW 2052, Australia
[3] NVIDIA Corp, Santa Clara, CA USA
关键词
Arrays; Data Parallelism; Embedded Language; Code Generation; Dynamic Compilation; GPGPU; Haskell; LLVM;
D O I
10.1145/2804302.2804313
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Embedded languages are often compiled at application runtime; thus, embedded compile-time errors become application runtime errors. We argue that advanced type system features, such as GADTs and type families, play a crucial role in minimising such runtime errors. Specifically, a rigorous type discipline reduces runtime errors due to bugs in both embedded language applications and the implementation of the embedded language compiler itself. In this paper, we focus on the safety guarantees achieved by type preserving compilation. We discuss the compilation pipeline of Accelerate, a high-performance array language targeting both multicore CPUs and GPUs, where we are able to preserve types from the source language down to a low-level register language in SSA form. Specifically, we demonstrate the practicability of our approach by creating a new type-safe interface to the industrial-strength LLVM compiler infrastructure, which we used to build two new Accelerate backends that show competitive runtimes on a set of benchmarks across both CPUs and GPUs.
引用
收藏
页码:201 / 212
页数:12
相关论文
共 50 条
  • [1] Expressive and Strongly Type-Safe Code Generation
    Winant, Thomas
    Cockx, Jesper
    Devriese, Dominique
    [J]. PROCEEDINGS OF THE 19TH INTERNATIONAL SYMPOSIUM ON PRINCIPLES AND PRACTICE OF DECLARATIVE PROGRAMMING (PPDP 2017), 2017, : 199 - 210
  • [2] Type-safe runtime class upgrades in Creol
    Yu, Ingrid Chieh
    Johnsen, Einar Broch
    Owe, Olaf
    [J]. FORMAL METHODS FOR OPEN OBJECT-BASED DISTRIBUTED SYSTEMS, 2006, 4037 : 202 - 217
  • [3] Type-Safe Code Transformations in Haskell
    Guillemette, Louis-Julien
    Monnier, Stefan
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2007, 174 (07) : 23 - 39
  • [4] WHAT IS TYPE-SAFE CODE REUSE
    PALSBERG, J
    SCHWARTZBACH, MI
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1991, 512 : 325 - 341
  • [5] CCured: Type-safe retrofitting of legacy code
    Necula, GC
    McPeak, S
    Weimer, W
    [J]. ACM SIGPLAN NOTICES, 2002, 37 (01) : 128 - 139
  • [6] CCured: Type-Safe Retrofitting of Legacy Code
    Necula, George C.
    McPeak, Scott
    Weimer, Westley
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (04) : 74 - 85
  • [7] Runtime support for type-safe dynamic Java']Java classes
    Malabarba, S
    Pandey, R
    Gragg, J
    Barr, E
    Barnes, JF
    [J]. ECOOP 2000 - OBJECT-ORIENTED PROGRAMMING, 2000, 1850 : 337 - 361
  • [8] A framework for building type-safe configurations for JVM using code generation techniques
    Puripunpinyo, Hussachai
    Samadzadeh, M. H.
    [J]. 2017 SYSTEMS AND INFORMATION ENGINEERING DESIGN SYMPOSIUM (SIEDS), 2017, : 50 - 55
  • [9] Fault-Safe Code Motion for Type-Safe Languages
    Murphy, Brian R.
    Menon, Vijay
    Schneider, Florian T.
    Shpeisman, Tatiana
    Adl-Tabatabai, Ali-Reza
    [J]. CGO 2008: SIXTH INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, PROCEEDINGS, 2008, : 144 - 154
  • [10] Generate and Offshore: Type-Safe and Modular Code Generation for Low-Level Optimization
    Takashima, Naoki
    Sakamoto, Hiroki
    Kameyama, Yukiyoshi
    [J]. FHPC'15 PROCEEDINGS OF THE 4TH ACM SIGPLAN WORKSHOP ON FUNCTIONAL HIGH-PERFORMANCE COMPUTING, 2015, : 45 - 53