Maroun, E. J., Schoeberl, M., & Puschner, P. (2023). Constant-Loop Dominators for Single-Path Code Optimization. In P. Wägemann (Ed.), 21th International Workshop on Worst-Case Execution Time Analysis (WCET 2023) (pp. 1–13). Schloss-Dagstuhl - Leibniz Zentrum für Informatik. https://doi.org/10.4230/OASIcs.WCET.2023.7
Single-path code is a code generation technique specifically designed for real-time systems. It guarantees that programs execute the same instruction sequence regardless of runtime conditions. Single-path code uses loop bounds to ensure all loops iterate a fixed number of times equal to their upper loop bound. When the lower and upper bounds are equal, the loop must iterate the same number of times, which we call a constant loop. In this paper, we present the constant-loop dominance relation on control-flow graphs. It is a variation of the traditional dominance relation that considers constant loops to find basic blocks that are always executed the same number of times. Using this relation, we present an optimization that reduces the code needed to manage single-path code. Our evaluation shows significant performance improvements, with one example of up to 90%, with mostly minor effects on code size.