This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Performance regression

On Wed, Sep 25, 2002 at 06:25:08PM +0200, Michael Matz wrote:
> The above transformation is also valid (for C and C++) if nothing is known
> about the upper bound, as for the equalitity of p1 and p2 to not hold it
> is necessary that a wrap around happens in one of the increments, which is
> undefined for signed ints.

But not for signed ints, and rtl does not have information
about the signedness of the original computation.  You need
to have proof that one of the values won't wrap.

See check_ext_dependent_givs in loop.c for some of this.


Of more interest to Alpha, and other platforms that can get
some extensions for free, is to note when

	r1:SI = (foo:SI ...)
	r2:DI = (extend:DI r1:SI)
	(use r1)
	(use r2)

At present, combine won't touch this because r1 is still live,
and it won't collapse computations that aren't made redundant.
Nor will cse do this, probably because it wasn't designed for it.

This would be better computed as

	r2:DI = (extend:DI (foo:SI ...))
	r1:SI = (subreg:SI r2:DI 0)
	(use r1)
	(use r2)

and hopefully the register allocator would coelesce r1 and r2
to the same hard register.  One would use rtx_cost to see when
this transformation is thought to be profitable.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]