Back to search

University of Pennsylvania

LOW-LEVEL SEMANTICS AND OPTIMIZATIONS

Abstract

dc:description.abstract

Modern optimizing compilers rely heavily on precise static analyses, such as alias analysis, to validate semantics-preserving program transformations. However, low-level languages like C and compiler intermediate representations like LLVM IR permit complex memory operations---such as casts between pointers and integers---that expose the underlying spatial layout of memory, invalidating important simplifying assumptions for analyses passes. These problems are exacerbated in the context of finite memory, which can prove disastrous for optimizations. Under finite memory, removing extraneous allocations becomes deeply challenging, and programs can exploit memory exhaustion to fabricate aliases to arbitrary regions via address guessing, severely complicating alias analysis. This dissertation introduces the two-phase memory model, which provides a novel solution to recover high-precision analysis and optimization passes for languages that provide low-level memory operations, while providing a principled methodology for executing programs under finite memory environments. The core insight is to split the language semantics into distinct infinite and finite memory settings, connected by a verified refinement relation. The infinite memory model gives meaning to programs regardless of the number of allocations they perform, and supports a wide range of optimizations (including those that alter how much memory is allocated). Operations that are traditionally difficult to support, like casts between pointers and integers, are fully supported under both infinite and finite memory models. Furthermore, the infinite memory semantics naturally guards against address guessing. Prior to introducing the two-phase memory model, we explore the design space of sequential memory models. This exploration provides the necessary context to evaluate our architectural decisions and serves as a reference for alternative designs. We integrate this two-phase memory model into \vir, a formal semantics for a subset of LLVM IR developed inside the Rocq proof assistant. We verify that the model permits critical optimizations, such as dead allocation removal, through formally proven example transformations. Additionally, to validate the correctness and practical correspondence of our formal specifications against industrial compiler behaviors, we develop a sound, executable reference interpreter for Vellvm. We utilize this verified interpreter as a trusted oracle to conduct rigorous differential testing against production LLVM implementations. This evaluation successfully uncovered subtle discrepancies in our initial semantics, as well as bugs within the production Clang compiler. Ultimately, this work provides a foundational framework for building semantics that can be used for verified, highly optimizing compilers for low-level languages.

Degree

thesis:*
Department dc:contributor.department
Computer and Information Science
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Beck, Calvin, Maxwell James
Advisor dc:contributor.advisor
  • Zdancewic, Stephan

Subjects

dc:subject × 7

Rights

Language dc:language.iso
en

Identifiers

dc:identifier.*
Repository record dc:identifier.uri
https://repository.upenn.edu/handle/20.500.14332/63193

Chain of custody

source
Harvested from
University of Pennsylvania
Base URL
repository.upenn.edu/server/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Beck, Calvin, Maxwell James. LOW-LEVEL SEMANTICS AND OPTIMIZATIONS. 2026. https://repository.upenn.edu/handle/20.500.14332/63193