Re: How to verify that optimizations preserve semantics

Stefan Monnier <monnier@iro.umontreal.ca>
Wed, 12 May 2010 10:50:36 -0400

          From comp.compilers

Related articles
How to verify that optimizations preserve semantics linuxkaffee_@_gmx.net (Stephan Ceram) (2010-05-11)
Re: How to verify that optimizations preserve semantics bfranke@inf.ed.ac.uk (=?ISO-8859-1?Q?Bj=F6rn_Franke?=) (2010-05-12)
Re: How to verify that optimizations preserve semantics monnier@iro.umontreal.ca (Stefan Monnier) (2010-05-12)
Re: How to verify that optimizations preserve semantics jeremy.wright@microfocus.com (Jeremy Wright) (2010-05-13)
Re: How to verify that optimizations preserve semantics tc@cs.bath.ac.uk (Tom Crick) (2010-05-13)
Re: How to verify that optimizations preserve semantics walter@bytecraft.com (Walter Banks) (2010-05-14)
Re: How to verify that optimizations preserve semantics cr88192@hotmail.com (BGB / cr88192) (2010-05-14)
| List of all articles for this month |
From: Stefan Monnier <monnier@iro.umontreal.ca>
Newsgroups: comp.compilers
Date: Wed, 12 May 2010 10:50:36 -0400
Organization: Compilers Central
References: 10-05-062
Keywords: optimize
Posted-Date: 12 May 2010 17:12:37 EDT

> I was wondering how compiler optimisations can be verified,
> i.e. whether they perform always valid code modifications? How is it
> done in practice?


AFAIK, it's mostly not done.


One of the easiest way to do it is try hard to split the optimization
into a first phase that analyzes the problem and comes up with a plan,
and a second phase that executes the plan, in such a way that most of
the complexity is in the first phase. So the verification can be done
by checking only the plan and the "executioner".


I.e. try as much as possible to perform your optimization by a complex
analysis&heuristic that ends up performing simple rewrite steps, so that
overall correctness only depends on the correctness of the simple
rewrite steps and not on the correctness of the complex
analysis&heursitic.




                Stefan



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.