This is the mail archive of the
mailing list for the GCC project.
RE: one question: tree-ssa vs no tree-ssa? no such global optimization exists.
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'J.C. Pizarro'" <jcpiza at gmail dot com>, <gcc at gcc dot gnu dot org>, "'Diego Novillo'" <dnovillo at google dot com>
- Date: Mon, 22 Oct 2007 15:16:06 +0100
- Subject: RE: one question: tree-ssa vs no tree-ssa? no such global optimization exists.
- References: <email@example.com>
On 20 October 2007 16:40, J.C. Pizarro wrote:
> * Was it useful the implementation of the complicated tree-ssa code
> waited for long time (many years)?
> * Was it better the optimization without tree-ssa code?
Why in a style like Yoda these questions you are asking?
> If doesn't exist a method for global optimization to use tree-ssa then
> * why did not it implement the simplest trial-and-error method for
> local optimization (e.g. minima/maxima local) following the K.I.S.S.
> principle without tree-ssa code?
Because 99% of the optimisations performed by gcc cannot be easily modeled
as a problem of local minima determination in a scalar field, and to do so
would be massively inefficient and overgeneralised compared to implementing
more specialised code to run the optimisation.
Your opinion is based on uninformed guesswork. Why don't you try making the
change yourself and performing *measurements*. This is science, not religion:
we make observations of the universe to find out what is the case, rather than
pronouncing that whatever we wish must somehow be true.
> There are other methods of search of minima/maxima local as Hill
> Climbing, Beam Search, Genetic Algorithms, Simulated Annealing, Tabu
> Search, A*, Alfa-Beta, Min-Max, Branch-and-Bound, Greedy, etc.
Well done. You've got a hammer. That doesn't mean that every problem in
the world just suddenly turned into a nail.
> The extension with more optimization's features is more easy without
> tree-ssa code.
Massively wrong, but you don't have to take my word for it: try it and see.
A few limited areas of some of the optimisations could be usefully modelled
in this way - for instance, it might be a useful technique for making better
decisions about when the costs and benefits of inlining a function were, or
combining insns whilst bearing in mind all the related costs; but that's only
helping you make the decision about whether or not to optimise in a particular
case, and you still need all the code that can parse the source under
compilation, spot opportunities for optimisation, and rearrange the IR into
the optimised form. That's where all the real complexity lies, and that's
what SSA makes a whole lot more efficient, reliable, and debuggable and
Can't think of a witty .sigline today....