dmd.backend.cgelem

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.

fillinops
bool fillinops(elem** ops, int* opsi, int maxops, int oper, elem* e)

Fill in opsmaxops with operands of repeated operator oper.

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

Suggestion Box / Bug Report