The instruction selection pass recognizes opportunities for using
combined arithmetic and logical operations and addressing modes
offered by the target processor. For instance, the expression x + 1
can take advantage of the "immediate add" instruction of the processor,
and on the PowerPC, the expression (x >> 6) & 0xFF can be turned
into a "rotate and mask" instruction.
Instruction selection proceeds by bottom-up rewriting over expressions.
The source language is Cminor and the target language is CminorSel.
We build a partial mapping from global identifiers to their definitions,
restricting ourselves to the globals we are interested in, namely
the external function declarations that are marked as runtime library
This ensures that the mapping remains small and that lookup_helper
below is efficient.