ClangIR and MLIR Development in the LLVM Project
Outside my academic research, I contribute independently to the LLVM Project.
In accelerator-oriented languages such as OpenCL C, information including types, address spaces, and kernel arguments must survive compilation; otherwise, later code-generation and runtime components cannot use it.
ClangIR (CIR) is a source-oriented intermediate representation between Clang’s frontend for C, C++, and related languages and LLVM IR, the lower-level representation used closer to machine-code generation. CIR is built on MLIR, a framework for defining intermediate representations for different domains and hardware targets and transforming them in stages.
Using this infrastructure, I implemented support for representing and generating OpenCL kernel-argument metadata in CIR and carrying it through MLIR’s LLVM dialect into LLVM IR. These changes have been merged into the LLVM Project. I also contribute fixes that replace crashes on invalid input with diagnostics and expand regression-test coverage.
This staged compiler infrastructure lets developers maintain support for multiple accelerators within one transformation framework while preserving and tracking program semantics and metadata throughout lowering. Longer term, I want to connect this compiler-level information with execution records from runtimes and hardware as a basis for verifying AI computation across heterogeneous accelerators.