dmd.backend.cgelem

Local optimizations of elem trees

Compiler implementation of the D programming language.

Does strength reduction optimizations on the elem trees, i.e. rewriting trees to less expensive trees.

Members

Functions

doptelem
elem* doptelem(elem* e, goal_t goal)

Optimize and canonicalize an expression tree. Fiddle with double operators so that the rvalue is a pointer (this is needed by the 8086 code generator).

elddtor
elem* elddtor(elem* e, goal_t goal)

Handle OPddtor

elemisnegone
int elemisnegone(elem* e)
elemisone
int elemisone(elem* e)
elmsw
elem* elmsw(elem* e, goal_t goal)

Handle OPmsw.

elpair
elem* elpair(elem* e, goal_t goal)

Handle OPpair, OPrpair.

elstruct
elem* elstruct(elem* e, goal_t goal)

See if we can replace struct operations with simpler ones. For OPstreq and OPstrpar.

postoptelem
void postoptelem(elem* e)

Do optimizations after bltailrecursion() and before common subexpressions.

swaprel
OPER swaprel(OPER op)

Swap relational operators (like if we swapped the leaves).

Meta