The Lazy-Code-Motion Problem It is desirable for programs optimized with a partial-redundancy- elimination algorithm to have the following properties: 1.All redundant computations of expressions that can be eliminated without code duplication are eliminated. 2.The optimized program does not perform any computation that is not in the original program execution. 3.Expressions are computed at the latest possible time We refer to the optimization of eliminating partial redundancy with the goal of delaying the computations as much as possible as lazy code motion. CS308 Compiler TheoryThe Lazy-Code-Motion Problem • It is desirable for programs optimized with a partial-redundancyeli i i l i h li m inat ion a lgor i t hm to h h ave t he f ll i o ow ing propert ies: 1. All redundant computations of expressions that can be eliminated with t d ithou t co de d li ti li i t d duplication are eli m ina t e d. 2. The optimized program does not perform any computation that is not in the original program execution original program execution. 3. Expressions are computed at the latest possible time. • We refer to the optimization of eliminating partial redundancy with the goal of delaying the computations as much as possible as goal of delaying the computations as much as possible as lazy code lazy code motion. CS308 Compiler Theory 9