What is it about?
When LLVM, one of the most widely used compiler frameworks, updated to version 17, it removed detailed type information from pointers in its intermediate representation, replacing all pointer types with a single generic opaque type called "ptr". While this simplified the compiler and reduced compile times, it broke LLVM passes that needed to know what type of data a pointer refers to. This paper presents Type Deduction Analysis (TDA), a new compiler pass that reconstructs this missing type information directly from the opaque-pointer code, without requiring source-level data. TDA is fully integrated into the LLVM pipeline and works at any stage of compilation. In our experiments on standard benchmark suites, TDA recovers up to 100% of pointer types, with an average recovery rate above 84%.
Featured Image
Photo by Brett Jordan on Unsplash
Why is it important?
LLVM's shift to opaque pointers has forced several compiler projects to remain tied to outdated LLVM versions, hindering their development and limiting new research opportunities. TDA is the first fully formalized, LLVM-integrated solution that recovers transparent pointer types without requiring source code or debug information, and that works on both unoptimized and optimized code. We demonstrate its practical impact by integrating it into two real-world LLVM frameworks — TAFFO for precision tuning and ASPIS for fault tolerance — successfully restoring their functionality on modern LLVM versions. This enables these and similar projects to benefit from years of LLVM improvements that were previously inaccessible.
Perspectives
This work originated from a concrete need: our research group at HEAPLab in Politecnico di Milano maintains both TAFFO and ASPIS, and the transition to opaque pointers was blocking their evolution. Rather than applying ad-hoc fixes, we chose to formalize the problem and develop a general-purpose solution that any LLVM-based project can adopt. We believe TDA fills a gap in the current LLVM ecosystem and hope it will help other teams facing the same challenge to modernize their toolchains.
Niccolò Nicolosi
Politecnico di Milano
Read the Original
This page is a summary of: Type Deduction Analysis: Reconstructing Transparent Pointer Types in LLVM-IR, January 2026, ACM (Association for Computing Machinery),
DOI: 10.1145/3771775.3786268.
You can read the full text:
Resources
Contributors
The following have contributed to this page







