Next: , Up: Optimizing Infix Binary Operators   [Index]


3.9.7.1 Right Identity Element Kill

The identity (or neutral) element is the element that with respect to a binary operation leaves other elements unchanged when combined with them.

The optimization removes the identity element combining operations, for which the identity element is the right operand.

The struct x1f4_1stscope_type operator definition extension is to include the X1f4_E4_POST_SKIP bit in its bits1 bits list field. The remaining optimization parameters, including the description (value) of the identity element, are to be introduced via the struct x1f4_operator_type first extension, in a struct x1f4_sdbo_type definition. That is, the extension1 field of the struct x1f4_operator_type operator description must point a struct x1f4_1stscope_type record, whose sdbo_data field must point a struct x1f4_sdbo_type record, in turn describing the optimization parameters.

See struct x1f4_1stscope_type.

See struct x1f4_sdbo_type.

See struct x1f4_operator_type.

See Operator First Extension Scope Flags.

The identity element must be of one of the intrinsic scalar types (integer, real or cardinal).

See Intrinsic Types.

It applies for such operators as the C binary ‘+’, ‘*’.

The optimization transforms expressions like:

e + 0
e * 1
e & ~0
e << 0

into:

e
e
e
e