lospre in linear time

11/21/2020
by   Philipp Klaus Krause, et al.
0

Lifetime-optimal speculative partial redundancy elimination (lospre) is the most advanced currently known redundancy elimination technique. It subsumes many previously known approaches, such as common subexpression elimination, global common subexpression elimination, and loop-invariant code motion. However, previously known lospre algorithms have high time complexity; faster but less powerful approaches have been used and developed further instead. We present a simple linear-time algorithm for lospre for structured programs that can also handle some more general scenarios compared to previous approaches. We prove that our approach is optimal and that the runtime is linear in the number of nodes in the control-flow graph. The condition on programs of being structured is automatically true for many programming languages and for others, such as C, is equivalent to a bound on the number of goto labels per function. An implementation in a mainstream C compiler demonstrates the practical feasibility of our approach. Our approach is based on graph-structure theory and uses tree-decompositions. We also show that, for structured programs, the runtime of deterministic implementations of the previously known MC-PRE and MC-SSAPRE algorithms can be bounded by O(n^2.5), improving the previous bounds of O(n^3).

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/20/2019

Partial Redundancy Elimination using Lazy Code Motion

Partial Redundancy Elimination (PRE) is a compiler optimization that eli...
research
05/04/2021

Simple, Light, Yet Formally Verified, Global Common Subexpression Elimination and Loop-Invariant Code Motion

We present an approach for implementing a formally certified loop-invari...
research
06/05/2021

APMF < APSP? Gomory-Hu Tree for Unweighted Graphs in Almost-Quadratic Time

We design an n^2+o(1)-time algorithm that constructs a cut-equivalent (G...
research
12/24/2019

Aggressive Aggregation: a New Paradigm for Program Optimization

In this paper, we propose a new paradigm for program optimization which ...
research
09/23/2017

A Simple Algorithm for Computing a Cycle Separator

We present a linear time algorithm for computing a cycle separator in a ...
research
07/11/2018

A Fixed-Parameter Linear-Time Algorithm for Maximum Flow in Planar Flow Networks

We pull together previously established graph-theoretical results to pro...
research
11/11/2020

Efficient global register allocation

In a compiler, an essential component is the register allocator. Two mai...

Please sign up or login with your details

Forgot password? Click here to reset