[ClangIR] Build and run SingleSource benchmarks using ClangIR

Description of the project: Clang codegen works by emitting LLVM IR through AST visitors. In the ClangIR project, we emit ClangIR from AST visitors instead, which can then be lowered to (a) LLVM IR directly or, alternatively, (b) MLIR in-tree dialects. Lowering is still a quite immature and lacks many instructions, attributes and metadata support. By improving it and pursuing parity with AST→LLVM IR codegen quality, ClangIR can incrementally bridge correctness and performance testing, providing a baseline for future higher level optimizations for C/C++ and/or mixing of MLIR dialects to improve specific workloads. A good starting point is to build and run simple benchmarks, measuring both generated code and build time performance. LLVM’s llvm-test-suite contains scripts and machinery that easily allows checking correctness and collecting perf related data and its SingleSource collection provide a set of simpler programs to build.

Expected result: Build and run programs from the SingleSource subdirectory from the lvm-test-suite, collect and present results (perf and build time) against regular (upstream) clang codegen.

Desirable skills: Intermediate C++ programming skills; familiarity with compilers, IRs and familiarity with Clang.

Project size: Medium

Difficulty: Medium

Confirmed Mentors: @bcardosolopes @lanza


Hello all

I have submitted a draft proposal for this project.

Please provide your valuable feedback to improve the proposal.


1 Like