On Wed, 18 Nov 2009 06:34:59 -0500, retard <r...@tard.com.invalid> wrote:

Tue, 17 Nov 2009 20:23:35 -0500, Robert Jacques wrote:

Also, all those well
known optimizations don't magically work for structs: I've seen modern
compilers do some pretty stupid things when structs and temporary values
are involved.

Are you talking about dmc/dmd now? Have you tried gcc 4.4 or 4.5, llvm
dev version or latest visual c++ ? Temporary values are often used with
e.g. expression templates and the compilers have generated decently
performing code for ages now. dmd is the only stupid compiler which
cannot inline e.g. expression templates for matrix operations.

The bug I'm thinking of was in the Open64 compiler, and I think it's been squashed now. But this happened in the last 2-3 years, and only was caught because a major vendor really stressed the performance of struct operations on a particular backend. (Nvidia and GPUs) The point, is that the actual optimization rules in the compiler for free variables and for structs are sometimes completely separate entities. It doesn't mean it can't be done, it just means it might have to be coded. Basically, Tuples introduce a level of obfuscation, which might (or might not) hamper the current optimizer.

Reply via email to