Type-Alias Analysis: Enabling LLVM IR with Accurate Types
Jinmeng Zhou, Ziyue Pan, Wenbo Shen, Xingkai Wang, Kangjie Lu, Zhiyun Qian
Abstract
LLVM Intermediate Representation (IR) underpins the LLVM compiler infrastructure, offering a strong type system and a static single-assignment (SSA) form that are well-suited for program analysis. However, its single-type design assigns exactly one type to each IR variable, even when the variable may legitimately correspond to multiple types. The recent introduction of opaque pointers exacerbates this limitation: all pointers in the IR are uniformly represented with a generic pointer type (ptr) that erases concrete pointee type information, making many type-based analyses ineffective. To address the limitations of single-type design, we introduce type-alias analysis, a multiple-type design that maintains type-alias sets for IR variables and infers types across IR instructions. We have developed TypeCopilot, a prototype that recovers concrete pointee types for opaque-pointer-enabled LLVM IR generated from C programs. TypeCopilot achieves 98.57% accuracy with 94.98% coverage, allowing existing analysis tools to retain their effectiveness despite the adoption of opaque pointers. To foster further research and security applications, we have open-sourced TypeCopilot, providing the community with a practical foundation for precise, type-aware security analyses on modern LLVM IR. CCS Concepts: • Software and its engineering → Software notations and tools.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 485efce0-2e87-40c6-90f4-186e4aea86d8Cited by top-tier papers1
Ask how each one uses itBuilds on24
- PAC it up: Towards Pointer Integrity using ARM Pointer AuthenticationHans Liljestrand, Thomas Nyman, Kui Wang, Carlos Chinea Perez et al.USENIX Security 2019 · 168 citations
- Where Does It Go?: Refining Indirect-Call Targets with Multi-Layer Type AnalysisKangjie Lu, Hong HuCCS 2019 · 142 citations
- Enforcing Kernel Security Invariants with Data Flow IntegrityChengyu Song, Byoungyoung Lee, Kangjie Lu, William Harris et al.NDSS 2016 · 141 citations
- Flow2Vec: value-flow-based precise code embeddingYulei Sui, Xiao Cheng, Guanqin Zhang, Haoyu WangOOPSLA 2020 · 94 citations
- PeX: A Permission Check Analysis Framework for Linux KernelTong Zhang, Wenbo Shen, Dongyoon Lee, Changhee Jung et al.USENIX Security 2019 · 77 citations
Related papers
- SoK: Demystifying Binary Lifters Through the Lens of Downstream ApplicationsZhibo Liu, Yuanyuan Yuan, Shuai Wang, Yuyan BaoS&P 2022 · 29 citations
- The road not taken: exploring alias analysis based optimizations missed by the compilerKhushboo Chitre, Piyus Kedia, Rahul PurandareOOPSLA 2022 · 13 citations
- TYPEPULSE: Detecting Type Confusion Bugs in Rust ProgramsHung-Mao Chen, Xu He, Shu Wang, Xiaokuan Zhang et al.USENIX Security 2025
- A Tough Call: Mitigating Advanced Code-Reuse Attacks at the Binary LevelVictor van der Veen, Enes Göktas, Moritz Contag, Andre Pawlowski et al.S&P 2016 · 227 citations
- Translation Validation for LLVM's AArch64 BackendRyan Berger, Mitch Briles, Nader Boushehrinejad Moradi, Nicholas Coughlin et al.OOPSLA 2025 · 3 citations
