[clang] [ClangIR] Add ABI Lowering Design Document (PR #178326)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 13 14:57:39 PST 2026


================
@@ -0,0 +1,602 @@
+# ClangIR ABI Lowering - Design Document
+
+## 1. Introduction
+
+This design describes calling convention lowering that **builds on the GSoC ABI
+Lowering Library** (PR #140112): we use its `abi::Type*` and target ABI logic
+and add an MLIR integration layer (MLIRTypeMapper, ABI lowering pass, and
+dialect rewriters).  The framework relies on the LLVM ABI library in
+`llvm/lib/ABI/` as the single source of truth for ABI classification; MLIR
+dialects use it via an adapter layer.  The design enables CIR to perform
+ABI-compliant calling convention lowering, be reusable by other MLIR dialects
+(particularly FIR), and achieve parity with the CIR incubator for x86_64 and
+AArch64. **What the design is, in concrete terms:** inputs are high-level
+function signatures in CIR, FIR, or other MLIR dialects; outputs are ABI-lowered
+signatures and call sites; lowering runs as an MLIR pass in the compilation
+pipeline, before dialect lowering to LLVM IR or other back ends.
----------------
andykaylor wrote:

```suggestion
Inputs are high-level function signatures in CIR, FIR, or other MLIR dialect.
Outputs are ABI-lowered signatures and call sites. Lowering runs as an MLIR pass
in the compilation pipeline.
```

https://github.com/llvm/llvm-project/pull/178326


More information about the cfe-commits mailing list