[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freepooma-devel] [PATCH] Optimize Vector arithmetic
From: |
Richard Guenther |
Subject: |
Re: [Freepooma-devel] [PATCH] Optimize Vector arithmetic |
Date: |
Wed, 24 Nov 2004 14:38:34 +0100 (CET) |
On Wed, 24 Nov 2004, Richard Guenther wrote:
> On Tue, 23 Nov 2004, Richard Guenther wrote:
>
> > Hi!
> >
> > Due to some oversight(??), Vector arithmetic is severely pessimized by
> > explicit creation of temporary Vectors. The attached patch "fixes" that
> > by removing the casts to Vector<...,Full> from the VectorOperators.
> > This tests ok, it even generates the same code as handwritten loops, but
> > there has to be a reason the code was like it was?
> >
> > So, please test this on your favorite Vector-using code. And report
> > breakage and/or performance.
Here's an updated patch with fixed what can be easily fixed.
Unfortunately with a non-optimizing compiler (-O0) we get extra
failures:
-PASSED ... array_test3
+FAILED ... array_test3
-PASSED ... array_test5
+FAILED ... array_test5
-PASSED ... array_test16
+FAILED ... array_test16
-PASSED ... array_test18
-PASSED ... array_test22
+FAILED ... array_test22
where array_test18 does not build due to the Stencil issue.
There has to be some we-use-a-reference-to-temporary around, as
doing optimized builds fixes the above failures. Obviously it's
nearly impossible to stare at unoptimized assembly, and compilers
are not very helpful in issuing diagnostics either.
I tried the Intel compiler which spits out a warning for every
void foo(const int& x);
void bar() { foo(1); }
in that we create temporary storage and pass a reference to that
temporary by reference. And that happens often. Very.
But maybe someone has a good non-EDG based C++ compiler.
Suspending the Vector speedup for now,
Richard.