RFC: merging MEM_ATTRS
Joern Rennecke
joern.rennecke@superh.com
Tue Feb 10 18:23:00 GMT 2004
[alias set]
> Right. But you also have the case where one is a subset of the other. In
> which case you can use the superset.
Agreed.
>
> expr: If all alternatives are identical, use that, otherwise use a
> PARALLEL.
> offset: Likewise.
>
> I think that it's simpler just to use zero: the information isn't that useful
> by then.
It isn't that useful to enable more optimizations, but necessary to avoid
incorrect ones, as discussede here:
http://gcc.gnu.org/ml/gcc-patches/2004-01/msg03234.html
If we zero the MEM_EXPR if one or more of the alternatives accesses
a variable that never has its address taken and that we reasoned thus
can only be accessed with explicit accesses, we would incorrectly assume
the MEM can't affect/use the variable any more.
> align: uses the lowest common denominator. Lowering the alignment of
> one or more of the alternatives is considered to incur a cost, although
> probably not a large one when we've selected structurally identically
> instructions in the first place.
>
> They are powers of two, so just use the lowest. But since we don't
> really use the alignment of a MEM that's already in an insn, I don't
> see the cost here.
I actually meant lowest common denominator as a figure of speech
but it happens so here that it's also a mathematically exact
description :-)
I'm not sure if we might want combine adjacent accesses at an early
optimization stage. OTOH, maybe that should happen before any
if-conversion / crossjumping would be considered in the first place.
Probably it's enough for now to just put a comment there that we might
associate a cost with this if it turns out to suppress optimizations.
More information about the Gcc
mailing list