Chuanqi Xu
Alibaba Cloud Development Engineer
Clang Modules & Serialization Owner, LLVM Committer, C++ Standard Committee member, Development Engineer in Aliyun's Programming Languages and Compilers team, responsible for the maintenance and promotion of compilation toolchain as well as the implementation, maintenance, and application of new features in C++ (e.g., Concurrency and Modules).
Topic
clangir: the next most important update to the clang compiler - clangir Status and Progress Report
Clang has been around for more than 20 years as a representative of the "new" generation of C++ compilers. Its core AST, the LLVM IR bipartite design, has shown some weaknesses as the semantic complexity of C++ continues to evolve, and as people become more and more concerned about the security of their programmes. On the one hand, the evolving semantics of C++ provides new scope for improving the performance of C++ programs, but LLVM is not good at, and theoretically should not be optimised with respect to, C++-specific semantics. On the other hand, people's concern about program security further deepens the pressure of program analysis, but the structure of AST makes it difficult to analyse on AST, and it is difficult to obtain C++ semantic information on LLVM. Meanwhile, due to the hotness of AI and the slowdown of unconditional growth of hardware arithmetic power, the need to improve the utilisation of hardware arithmetic power has driven the further development of the compiler field, and MLIR (Multiple Level Intermediate Representation) has gained great popularity among developers for its strong scalability, and has gained significant development. In this context, ClangIR was developed to meet the needs of developers, ClangIR is a dialect based on MLIR, through the ability provided by MLIR, compiler developers can optimise their programs based on C++ semantics on ClangIR, and at the same time, they can analyse them based on C++ semantic information, avoiding the dilemma of choosing between AST and LLVM. At the same time, ClangIR may also have the opportunity to reuse the existing capabilities in different areas through other Dialect of MLIR. ClangIR is expected to be the largest and most important update to the Clang community in recent years. In this analysis, we will present the current status of ClangIR's development, recent developments, and long-term outlook.