Changes between Version 13 and Version 14 of Commentary/Compiler/NewCodeGenPipeline
- Timestamp:
- 08/27/08 00:46:29 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Compiler/NewCodeGenPipeline
v13 v14 19 19 20 20 Code generation now has three stages: 21 * Convert STG to Cmm, with implicit stack implicit, and native Cmm calls. 22 * Optimise the Cmm, and CPS-convert it to have an explicit stack, and no native calls. 23 * Feed the CPS-converted Cmm to the existing, unmodified native code generators. 21 1. Convert STG to Cmm, with implicit stack implicit, and native Cmm calls. 22 2. Optimise the Cmm, and CPS-convert it to have an explicit stack, and no native calls. 23 3. Feed the CPS-converted Cmm to the existing, unmodified native code generators. 24 25 The first two steps are described in more detail here: 24 26 25 27 * '''Code generator''' converts STG to `CmmGraph`. Implemented in `StgCmm*` modules (in directory `codeGen`). 26 * Parameter passing and stack adjustments are made explicit using the [wiki:Commentary/Compiler/StackAreas ''Stack Area'' abstraction.]27 * That includes a store of the return address .28 * Parameter passing is made explicit. Parameters are passed in virtual registers R1, R2 etc. Overflow parameters are passed on the stack using explicit memory stores, to locations described abstractly using the [wiki:Commentary/Compiler/StackAreas ''Stack Area'' abstraction.]. 29 * That includes a store of the return address, which is stored explicitly on the stack in the same way as overflow parameters. 28 30 * No `CopyIn`, `CopyOut` nodes any more; instead "smart constructors" lower the calling convention to loads/stores/register transfers, using stack area abstraction. 29 31 * But we still have `LastCall`, `LastReturn`, `LastBranch`, `LastJump` as `Last` nodes.
