# GSoC 2025: Introducing an ABI Lowering Library

DevFeed: [GSoC 2025: Introducing an ABI Lowering Library](<https://devfeed.tech/articles/gsoc-2025-introducing-an-abi-lowering-library-43116.md>)

Original publisher: [Read original article](<https://blog.llvm.org/posts/2025-08-25-abi-library/>)

Author: Narayan Sreekumar (vortex73)

Published: 2025-11-03T00:00:00Z

Content type: article

Language: en

Sources: [LLVM Project](<https://devfeed.tech/sources/the-llvm-project-blog.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Library](<https://devfeed.tech/topics/library.md>), [C](<https://devfeed.tech/topics/c.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [abstraction](<https://devfeed.tech/topics/abstraction.md>)

Tags: [2025](<https://devfeed.tech/tags/2025.md>), [abi](<https://devfeed.tech/tags/abi.md>), [c](<https://devfeed.tech/tags/c.md>), [clang](<https://devfeed.tech/tags/clang.md>), [codegen](<https://devfeed.tech/tags/codegen.md>), [gsoc](<https://devfeed.tech/tags/gsoc.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [library](<https://devfeed.tech/tags/library.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [sysv](<https://devfeed.tech/tags/sysv.md>), [type-system](<https://devfeed.tech/tags/type-system.md>)

## AI overview

An LLVM GSoC 2025 project extracts target-specific ABI lowering logic from Clang into a reusable library. The library introduces an independent ABI type system and maps frontend types to ABI types to support correct C interoperability across different calling conventions.

## Source excerpt

Introduction In this post I'm going to outline details about a new ABI lowering library I've been developing for LLVM as part of GSoC 2025! The aim was to extract the ABI logic from Clang and create a reusable library that any LLVM frontend can use for correct C interoperability. The Problem We're Solving At the start of the program, I wrote about the fundamental gap in LLVM's target abstraction. The promise is simple: frontends emit LLVM IR, and LLVM handles everything else. But this promise completely breaks down when it comes to Application Binary Interface (ABI) lowering. Every LLVM frontend that wants C interoperability has to reimplement thousands of lines of target-specific ABI logic. Here's what that looks like in practice: struct Point { float x, y; };struct Point add_points(struct Point a, struct Point b); Seems innocent enough, right? But generating correct LLVM IR for this requires knowing: Are the struct arguments passed in registers or memory? If in registers, what register class is used? Are multiple values packed into a single register? Is the struct returned in registers or using a hidden return parameter? The answer depends on subtle ABI rules that are target-specific, constantly evolving, and absolutely critical to get right. Miss one detail and you get silent memory corruption. This godbolt link shows the same simple struct using six different calling conventions across six different targets. And crucially: a frontend generating IR needs to know ALL of this before it can emit the right function signature. As I outlined in my earlier blog post, LLVM's type system simply can't express all the information needed for correct ABI decisions. Two otherwise identical structs with different explicit alignment attributes have different ABIs. __int128 and _BitInt(128) look similar but follow completely different rules. The Design Independent ABI Type System At the heart of the library is llvm::abi::Type, a type system designed specifically for ABI decisions