Lessons in TableGen
Channel: FOSDEM
Date: 2019-02-08

by Nicolai Hähnle

At: FOSDEM 2019
https://video.fosdem.org/2019/K.4.201/llvm_tablegen.webm


TableGen is LLVM's DSL for describing intrinsics, backends' machine instructions, physical registers, machine scheduling models, and a bunch of other things. It is extremely flexible and powerful, but can also be rather aggravating. Most people who spend a significant amount of time working on an LLVM backend probably develop a love/hate-relationship with it. 

The goal of this talk is to give a brief overview of what TableGen offers -- frontend, application-specific backends, generic table emission backend, idiosyncratic type system, and these days even limited functional-style programming -- and a brief introduction on how to use it. The focus will be mostly on the frontend -- that is, syntax and semantics of the TableGen DSL itself -- rather than on specific backends. 

Along the way, I want to share some lessons learned and decisions made during a major refactoring of the TableGen frontend that I undertook in early 2018 to iron out many of TableGen's quirks and shortcomings that had accumulated over the years, as well as some glimpses of the advanced TableGen uses in the AMDGPU backend that motivated that refactoring. 

Room: K.4.201
Scheduled start: 2019-02-03 12:00:00+01