(a+b)+c should be replaced by a+(b+c)

Robert Dewar dewar@gnat.com
Thu Mar 25 15:18:00 GMT 2004


Joost VandeVondele wrote:

> No, I'm only happy there are compilers that make my code 100 times faster
> without doing a lot of work myself, keeping my code easy to maintain and
> read.

Well it is fine to have this kind of transformation available as an
option, though in general it is better to rely on BLAS written by
competent numerical programmers, than on transformations of unknown
impact.

> Another example that relies on this kind of optimization that comes to my
> mind is OMP/MPI code. There is just a large class of problems for which
> this optimization is just what is needed.

Please do not call this an optimization, call it a transformation




More information about the Gcc mailing list