On Wed, 2005-06-29 at 18:46 +0200, Steven Bosscher wrote:
> On Tuesday 28 June 2005 14:09, Steven Bosscher wrote:
> > On Tuesday 28 June 2005 14:02, Ulrich Weigand wrote:
> > > Steven Bosscher wrote:
> > > > Anyway, I've started a SPEC run with "-O2" vs. "-O2 -fwrapv".  Let's
> > > > see how big the damage would be ;-)
> > >
> > > Please make sure to include a 64-bit target, where it actually makes any
> > > difference.  (I recall performance degradations of 20-30% in some
> > > SPECfp cases from getting induction variable reduction wrong ...)
> >
> > Yeah, I'm testing on an AMD64 box, both 64 bits and 32 bits.
> 
> And the numbers are, only those tests that build in both cases,
> left is base == "-O2", right is peak == "-O2 -fwrapv:

None of these numbers actually include real loop transformations that
often take advantage of wrapping semantics, so it's not interesting. 
In fact, i'm surprised that the numbers are different *at all*.

It's only heavy duty reordering things like vectorization, linear loop
transforms, distribution, you name it, etc, that really want to know the
number of iterations in a loop, etc that it makes any significant
difference.

So i would advise anyone arguing against turning on -fwrapv simply
because it doesn't seem to hurt us at O2.

And i'll again point out that the exact opposite is the default in every
other compiler i'm aware of.

XLC at O2 has qstrict_induction on by default (the equivalent), and
warns the user when it sees a loop where it's making the assumption[1]

The XLC people told me since they turned this on in 1998, they have had
one real piece of code where it actually mattered, and that was a char
induction variable.

ICC does the same, though i don't think it bothers to warn.

Open64 does the same, but no warning.

Not sure about Sun CC, but i'd be very surprised if they did it.

Personally, i only care about wrapping for induction variables.  If you
guys want to leave regular variables to do whatever, fine.

But if you turn on this wrapping behavior, you have more or less given
up any chance we have of performing heavy duty loop transforms on most
real user code, even though the user doesn't actually give two shits
about wrapping.

--Dan

[1] The manual points out the performance degradation using the option
is quite severe. I've sent actual numbers privately to some people, but
i don't want to make them public because i'm not sure the xlc folks
would like it.



Reply via email to