PrETi: Predicting Execution Time in Early Stage with LLVM and Machine Learning Conference: ; ; Price: 15.00 CCS: Computer systems organization Real-time system specification
Risheng Xu, Philipp Sieweck, Hermann von Hasseln, Dirk Nowotka · 2025
Read PrETi: Predicting Execution Time in Early Stage with LLVM and Machine Learning Conference: ; ; Price: 15.00 CCS: Computer systems organization Real-time system specification by Risheng Xu, Philipp Sieweck, Hermann von Hasseln, Dirk Nowotka (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-13679.txt.
Introduction
Risheng Xu, Philipp Sieweck, Hermann von Hasseln, and Dirk Nowotka predict how long a program will run before it is finished. Their 2025 paper introduces PrETi, a framework for early-stage timing checks. Knowing run time early helps teams that build real-time systems, where late surprises are costly.
PrETi runs the code inside a compiler-based simulator and counts timing clues, such as how many low-level instructions execute. It also models cache use and branch guessing. Those clues join past run-time records to train a learning model. On public benchmarks the method's average error was 11.98 percent, beating the prior state of the art. The authors present it as a robust tool for timing analysis while code is still young. Such checks can steer design before hardware is locked in.
Catalog record
| CREATOR | Risheng Xu, Philipp Sieweck, Hermann von Hasseln, Dirk Nowotka |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 46 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2503-13679
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
PrETi: Predicting Execution Time in Early Stage with LLVM and Machine Learning Conference: ; ; Price: 15.00 CCS: Computer systems organization Real-time system specification Risheng Xu, Philipp Sieweck, Hermann von Hasseln, Dirk Nowotka Abstract . We introduce preti , a novel framework for predicting software execution time during the early stages of development. preti leverages an LLVM-based simulation environment to extract timing-related runtime information, such as the count of executed LLVM IR instructions. This information, combined with historical execution time data, is utilized to train machine learning models for accurate time prediction. To further enhance prediction accuracy, our approach incorporates simulations of cache accesses and branch prediction. The evaluations on public benchmarks demonstrate that preti achieves an average Absolute Percentage Error (APE) of 11.98%, surpassing state-of-the-art methods. These results underscore the effectiveness and efficiency of preti as a robust solution for early-stage timing analysis. 1. Introduction In safety-critical real-time systems, timing analysis is essential to ensure that all tasks meet their deadlines. A widely adopted industry approach is measurement-based analysis, which helps mitigate the overly pessimistic estimates often associated with multi-core CPUs due to factors such as race conditions and cache coherency. Typically, timing measurements are conducted during the late stages of development, once all functional modules are integrated into a complete system. While this approach ensures that the system is evaluated under realistic conditions, it introduces two major challenges: (1) Failure Risks: The measurement functionality itself, being part of the real-time system, is susceptible to failure if timing violations occur. For instance, the transmission of measurement results can be interrupted by an overrun task, leading to incomplete or inaccurate data. This not only compromises the reliability of the timing analysis but also increases the risk of undetected timing violations in the final system. (2) Limited Insight: Unlike functional testing, which includes both system-level and unit-level tests, timing measurements are predominantly conducted at the system level. The absence of unit-level timing measurements restricts the ability to perform fine-grained debugging, making it difficult to identify and address performance bottlenecks early. As a result, timing issues often go undetected until system integration, where they escalate into more complex and costly problems. Despite the clear requirement of unit-level timing measurement before system integration, its practical implementation is hindered by challenge: Unlike functional tests, which can be executed in simulators such as Software-in-the-Loop (SiL) ( Demers et al. 2007 ) , timing measurements are typically performed on real embedded hardware. This is because timing behavior is highly dependent on hardware-specific factors such as CPU micro-architecture, memory hierarchy, and bus contention, which are difficult to accurately replicate in simulation environments. While simulators are effective for functional validation, they often fail to provide the level of accuracy and efficiency needed for timing analysis. As a result, real hardware measurements remain the preferred approach, despite their higher cost. The challenge are further exacerbated in large-scale software projects, where hundreds of engineers work in parallel. In such environments, the demand for frequent timing measurements—such as on every code commit—incurs substantial costs in terms of both hardware resources and engineering effort. Recent advancements have explored the use of machine learning-based prediction models to reduce the reliance on frequent timing measurements. These models utilize features extracted from various representations of software, such as source code ( Bonenfant et al. 2017 ; Huybrechts et al. 2018 ; Amalou et al. 2021 ) , binary files ( Amalou et al. 2024 ) , or assembly sequences ( Amalou et al. 2022 ; Amalou et al. 2023 ) , with time measurements collected from dedicated hardware serving as labels. While these approaches show promise, each feature extraction method has its limitations: • Source Code: Features derived from source code often fail to accurately reflect the actual execution behavior due to compiler optimizations. For example, dead code elimination, loop unrolling, and inlining can significantly alter the executed instructions compared to the original source code. As a result, features extracted from source code may overcomplicate the logic and yield overly pessimistic predictions. • Binary File: Analyzing executed assembly sequences from binary files using static code analysis is challenging. While identifying instructions within a basic block is straightforward, linking these blocks to form the complete execution path triggered by specific input parameters is non-trivial. Traditional tools, such as Implicit Path Enumeration Technology (IPET) ( Li and Malik 1995 ) , enumerate possible paths without considering input-dependent behavior, which can lead to overestimations of path length. Consequently, binary-based analysis remains an incomplete solution for predicting execution time accurately. • Assembly Sequence: Although executed assembly sequence contain precise execution information, capturing such sequences via hardware debugger (e.g. Lauterbach ( Lauterbach GmbH 2025 ) ) is as costly as performing time measurements on most platforms. Additionally, parsing assembly sequence requires tools tailored to specific instruction sets, adding further complexity. As a result, assembly-based analysis is often impractical for early-stage timing prediction. Given these limitations, there is a clear need for a hardware-independent yet representative data format to describe time-related features of function modules, making it applicable for early-stage prediction models. We propose that the LLVM Intermediate Representation (IR) ( Lattner and Adve 2004 ) is a promising format for this purpose. LLVM IR provides a high-level, platform-agnostic representation of code that captures both the structure and semantics of the program while remaining independent of specific hardware architectures. This makes it an ideal candidate for extracting features that are both representative of execution behavior and suitable for machine learning-based timing prediction. 2. Contributions In this work, we present preti , an end-to-end framework for predicting the software execution time under specific input parameters. Our contributions are highlighted as follows: (1) We develop multiple LLVM passes to instrument the LLVM IR code, enabling the modeling of dynamic execution behavior. The instrumentation generates detailed execution traces, including basic block execution counts, data cache access hits and misses, and branch decisions. These traces capture the runtime behavior of the program, providing a robust foundation for accurate execution time prediction. (2) We process the trace data to extract meaningful feature vectors, which are used to train machine learning models. By leveraging existing timing measurements as labels, our models are trained on a dataset of 1348 code samples, all compiled with the -O2 optimization level. (3) Our models achieve an Absolute Percentage Error (APE) of 11.98% on the public benchmark, surpassing state-of-the-art approach. The results highlight preti as a practical and efficient solution for early-stage timing analysis, reducing the demand for time-consuming measurements. 3. Background 3.1. Use Case In industry, the development of real-time systems typically follows a structured process consisting of several stages: requirements analysis, module implementation, unit test with early-stage timing analysis (ESTA), scheduling and integration (S&I), and system test with late-stage timing analysis (LSTA). Scheduling plays a critical role in this process, as it determines the allocation of tasks to CPUs and data to memory. We define the early stage as the phase before S&I, during which software modules are developed and tested independently. The late stage begins after S&I, when the entire system is integrated and available for testing. The primary goal of LSTA is to ensure that the complete real-time system is safe and free from timing violations. In contrast,