Serious performance regression -- some tree optimizer questions

Zdenek Dvorak
Tue Dec 21 20:56:00 GMT 2004


> I apologize if this comment is misplaced, but it seems that one of the
> things that tree optimization seems not to be doing (which seems important,
> and would seem to simplify the determination of expressions sensitivity to
> overflow, etc.) is to identify the maximum precision actually required of
> any operation/operand evaluation based on it's assigned destination's actual
> precision requirement (as although expressions may overflow it's use may be
> insensitive to it).
> As it seems for example, given:
>   (size-x)X = (size-y)Y (size-binop)BINOP (size-z)Z;
> - (size-binop) need never be wider than the smaller of either: it's
>   destination (size-x) requirement, or maximum result size of the binop
>   with (size-y) and (size-z) operands.
> - and corespondingly (size-y)X and (size-z)Y need never be literally
>   promoted unless the target-machine's (size-binop) operation requires it,
>   but may be logically demoted if exceeding the precision requirements of
>   the operation as determined by it's destination precision requirements
> In other words, determine precision / overflow sensitivities from the top
> (the last assigned use) of the expression tree down, not the bottom up
> without knowledge of the expressions true need? (where the same basic rules
> may be applied during the initial construction of the tree as well).

can you please provide a concrete testcase? I probably do not understand
correctly what you describe.


More information about the Gcc mailing list