Type Deduction Analysis: Reconstructing Transparent Pointer Types in LLVM-IR

Read full text
Authors: Niccolò Nicolosi, Gabriele Magnani, Emilio Corigliano, Davide Baroffio, Federico Reghenzani, Giovanni Agosta
Cited by: 0
References: 17

Abstract

With version 17, LLVM finalized the transition to opaque pointer types, eliminating explicit pointee‑type information from the Intermediate Representation (IR). Thus, starting from LLVM 17, each pointer type is represented in IR by the unique type ptr. Despite eliminating redundant pointer bitcasts and consequently reducing IR size and compile time, this change disrupts analyses that have reason to rely on pointee-type information, forcing existing compiler projects to depend on outdated LLVM versions. This information can in fact be insightful in fields like approximate computing, where the compiler can apply non-conservative optimizations, or in passes that require it to make analyses and transformations that do not impact the correctness of the program. To address this problem, we present a new Type Deduction Analysis pass that reconstructs transparent pointer types directly from opaque‑pointer IR. Moreover, we illustrate two different case-studies on existing LLVM projects, namely TAFFO and ASPIS, that demonstrate the need for pointee-type information in LLVM compilers.

Fields of Study & Subjects

Logic programming and type systems Parallel Computing and Optimization Techniques Embedded Systems Design Techniques

Publication details

Journal / source
ACM SIGPLAN International Conference on Compiler Construction (CC)
Pages
194–204
Publication date
28 January 2026
Language
EN