Doctoral thesis

Compiler-intermediate-representation-level profiling to analyze and perform compiler optimizations

  • 2025

PhD: Università della Svizzera italiana

English Managed language runtime systems often improve runtime performance by employing optimizing compilers that produce machine code via a pipeline of code transformations and optimizations. To analyze and perform compiler optimizations, compiler developers frequently use profiling techniques to track specific bytecode- and machine-code-level events in a program's execution. Unfortunately, these techniques do not allow profiling compiler-internal concepts related to the managed runtime or speculative optimizations (e.g., the lock implementation that the compiler selects, safepoints, or the typechecks that the compiler speculatively executes) and often lead to inaccurate measurements of high-level events, such as object allocations or method invocations. The lack of techniques to accurately and efficiently profile compiler-internal events limits the ability of compiler developers to assess the effects of compiler optimizations as well as the design of profile-guided optimizations (PGO) that benefit from such compiler-internal event profiles to perform optimizations within the compiler. Our work aims at bridging this gap by designing a novel technique to accurately and efficiently track compiler-internal events and show the applicability of our technique to analyze and perform compiler optimizations. In this dissertation, we propose a novel compiler-IR-level instrumentation technique and then implement an event-counting and an event-tracing profiler based on our technique, which are helpful in analyzing compiler optimizations as well as for PGOs. Concretely, we first demonstrate that the event-counting profiler implementing the proposed technique is useful by presenting an analysis of the root causes behind a performance speedup and an unexpected slowdown introduced by two compiler optimizations. Then, we demonstrate the usefulness of our event-tracing profiler with a PGO for improving the startup performance of Native-Image binaries, i.e., native executables produced by compiling Java code ahead-of-time employing GraalVM Native Image, by changing their layout during compilation, reducing I/O traffic. In particular, we use the proposed technique to collect the execution-order profiles of methods and the access-order profiles of objects. Thanks to these profiles, we reduce page faults related to the code section and the heap snapshot section of Native-Image binaries. Since the object identities and the heap-snapshot contents are not persistent across Native-Image builds of the same program, we propose a novel approach to improve the mapping between semantically equivalent objects in different binaries of a Native-Image application. Our PGO leads to an average startup speedup of 1.98×. To summarize, our work shows that event profiling can be accurately and efficiently performed at the compiler's IR level, enabling a better understanding of compiler optimizations, and that compiler-internal events enable PGO, yielding startup performance improvements.
Collections
Language
  • English
Classification
Computer science and technology
License
License undefined
Open access status
green
Identifiers
Persistent URL
https://n2t.net/ark:/12658/srd1332632
Statistics

Document views: 5 File downloads:
  • 2025INF010.pdf: 2