Talk
Beginner
First Talk

LLVM IR Is A Reasonable Programming Language

Review Pending

This talk will demonstrate that LLVM IR as a programming language of its own right and not just a tool for building compilers. We will explore its strong type system, how basic blocks structure control flow, and the formation Static Single Assignment (SSA) along with phi nodes. We will also exhibit how common optimisations like inlining, tail call elimination, and leveraging SIMD instructions manifest at this level.

Systems programming languages offer significant speed advantages due to compile-time analyses and optimisations. Given that a good number of systems languages are built on the LLVM toolchain, examining how language front-ends like C/C++ (clang), Rust, and others represent code in their compilers’ intermediate compilation passes can unlock a whole new perspective in understanding optimisations that follow (and what optmisations can be introduced!).

It is surprisingly easy to treat LLVM IR as a readable and understandable programming language. With the right knowledge of how LLVM constructs maps to assembly, one can write blazingly fast code without needing a language (front-end) at all!

In cases where extreme performance is paramount, such as in High-Frequency Trading (HFT) or High-Performance Computing (HPC), writing code in a level lower than the programming language itself will enable you to harness machine- and context-specific optimisations that language front-ends may fail to realise.

To illustrate this practically, our talk will showcase a hand-optimised base64 decoder [tool](https://github.com/MainKt/base64-ll) written directly in LLVM IR that makes use of its SIMD intrinsics. We will demonstrate how explicitly leveraging low-level features like SIMD operations can yield significant performance gains over a conventionally compiled version.

Expected duration: 20 - 22 mins.

  • Ability to read and understand LLVM IR.

  • Insight into compiler optimisation techniques from the IR level.

  • A burning desire to ditch your favourite low-level programming language in favour of a compiler IR!!!

Technology architecture
Engineering practice - productivity, debugging
Which track are you applying for?
Compilers, Programming Languages and Systems Devroom

Vyasa M Nayak
Software Development Engineer Verifone Inc.
https://www.linkedin.com/in/vyasa-m-nayak/
Speaker Image
Muhammad Saheed
Student | GSoC Contributor FreeBSD
https://saheed.tech/
Speaker Image

0 %
Approvability
0
Approvals
0
Rejections
0
Not Sure
No reviews yet.