D 2017-10-20T18:32:17.739 L Notes\sto\sself N text/x-markdown U kc5tja W 905 PASSES: 1. LIR generation 1. If any instruction is a CALL, annotate that we must save the RA register. 1. Recognize all literals -2048 <= x <= 2047. 1. Migrate constants: -2B <= x <= 2B but not -2048 <= x <= 2047 --> LUI/ADDI pairs 1. Migrate big constants into constant pool for this procedure. 1. If constant pool is non-empty, annotate that we must save/reset/restore GP. 1. Insert SYNCs at basic block boundaries. [1] 1. Decompose higher-level primitives until (more or less) one primitive maps to one CPU instruction. 1. Assemble the remaining primitives into a symbolic assembly listing. 1. Peephole optimize. Replace common phrases/idioms with shorter equivalents. 1. Expand prolog, epilog. 1. Generate final binary image from remaining (symbolic) assembly listing. Notes 1. We may elide this step if we're careful to introduce them when first generating LIR code. Z 2799229d26b1aa07547a9754d85fda26