[clang] [clang][NFC] Create CodeGenShared component for shared code with ClangIR (PR #157936)
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 22 10:08:54 PDT 2025
rjmccall wrote:
So, part of the problem here is that it's not tenable long-term for Clang to support completely separate lowering libraries for lowering to LLVM IR and LLVM-dialect MLIR. I continue to believe that the Clang IR work should be focused on lowering to LLVM IR because that will be the required IR for the rest of the compilation pipeline for the foreseeable future. Clients that want LLVM-dialect MLIR can get it by translating from LLVM IR, which will definitely add overhead for those clients, but that is then a problem we can tackle separately with some sort of compile-time or possibly even run-time abstraction. Chris Lattner suggested exactly this path at last fall's conference.
The problem with your current technical approach is exactly this: you effectively forked CodeGen two or three years ago, and when this work is done in two or three more years, we will have two independent implementations that I have no idea how we will ever re-integrate. This has been repeatedly pointed out, and it's hard not to reach the conclusion that a lot of the people working on Clang IR simply don't expect to have to deal with the problem because they are focused on supporting out-of-tree clients.
https://github.com/llvm/llvm-project/pull/157936
More information about the cfe-commits
mailing list