Rename CmmCPS to CmmPipeline.
[ghc-hetmet.git] / compiler / cmm / cmm-notes
index c0ccadf..4a87911 100644 (file)
@@ -1,3 +1,34 @@
+More notes (June 11)\r
+~~~~~~~~~~~~~~~~~~~~\r
+* Possible refactoring: Nuke AGraph in favour of \r
+      mkIfThenElse :: Expr -> Graph -> Graph -> FCode Graph\r
+  or even\r
+      mkIfThenElse :: HasUniques m => Expr -> Graph -> Graph -> m Graph\r
+  (Remmber that the .cmm file parser must use this function)\r
+\r
+  or parameterise FCode over its envt; the CgState part seem useful for both\r
+\r
+* "Remove redundant reloads" in CmmSpillReload should be redundant; since\r
+  insertLateReloads is now gone, every reload is reloading a live variable.\r
+  Test and nuke.\r
+\r
+* Sink and inline S(RegSlot(x)) = e in precisely the same way that we\r
+  sink and inline x = e\r
+\r
+* Stack layout is very like register assignment: find non-conflicting assigments.\r
+  In particular we can use colouring or linear scan (etc).\r
+\r
+  We'd fine-grain interference (on a word by word basis) to get maximum overlap.\r
+  But that may make very big interference graphs.  So linear scan might be\r
+  more attactive.\r
+\r
+  NB: linear scan does on-the-fly live range splitting.\r
+\r
+* When stubbing dead slots be careful not to write into an area that\r
+  overlaps with an area that's in use.  So stubbing needs to *follow* \r
+  stack layout.\r
+\r
+\r
 More notes (May 11)\r
 ~~~~~~~~~~~~~~~~~~~\r
 In CmmNode, consider spliting CmmCall into two: call and jump\r
@@ -217,7 +248,7 @@ CmmCvt.hs      Conversion between old and new Cmm reps
 CmmOpt.hs      Hopefully-redundant optimiser\r
 \r
 -------- Stuff to keep ------------\r
-CmmCPS.hs                 Driver for new pipeline\r
+CmmPipeline.hs            Driver for new pipeline\r
 \r
 CmmLive.hs                Liveness analysis, dead code elim\r
 CmmProcPoint.hs           Identifying and splitting out proc-points\r
@@ -264,24 +295,24 @@ BlockId.hs          BlockId, BlockEnv, BlockSet
       type RawCmm = GenCmm CmmStatic [CmmStatic] (ListGraph CmmStmt)\r
 \r
 * HscMain.tryNewCodeGen\r
-    - STG->Cmm:    StgCmm.codeGen (new codegen)\r
-    - Optimise:    CmmContFlowOpt (simple optimisations, very self contained)\r
-    - Cps convert: CmmCPS.protoCmmCPS \r
-    - Optimise:    CmmContFlowOpt again\r
-    - Convert:     CmmCvt.cmmOfZgraph (convert to old rep) very self contained\r
+    - STG->Cmm:         StgCmm.codeGen (new codegen)\r
+    - Optimize and CPS: CmmPipeline.cmmPipeline\r
+    - Convert:          CmmCvt.cmmOfZgraph (convert to old rep) very self contained\r
 \r
 * StgCmm.hs  The new STG -> Cmm conversion code generator\r
   Lots of modules StgCmmXXX\r
 \r
 \r
 ----------------------------------------------------\r
-      CmmCPS.protoCmmCPS   The new pipeline\r
+      CmmPipeline.cmmPipeline   The new pipeline\r
 ----------------------------------------------------\r
 \r
-CmmCPS.protoCmmCPS:\r
-   1. Do cpsTop for each procedures separately\r
-   2. Build SRT representation; this spans multiple procedures\r
-       (unless split-objs)\r
+CmmPipeline.cmmPipeline:\r
+   1. Do control flow optimization\r
+   2. Do cpsTop for each procedures separately\r
+   3. Build SRT representation; this spans multiple procedures\r
+        (unless split-objs)\r
+   4. Do control flow optimization on all resulting procedures\r
 \r
 cpsTop:\r
   * CmmCommonBlockElim.elimCommonBlocks:\r
@@ -419,7 +450,7 @@ a dominator analysis, using the Dataflow Engine.
   f's keep-alive refs to include h1.\r
 \r
 * The SRT info is the C_SRT field of Cmm.ClosureTypeInfo in a\r
-  CmmInfoTable attached to each CmmProc.  CmmCPS.toTops actually does\r
+  CmmInfoTable attached to each CmmProc.  CmmPipeline.toTops actually does\r
   the attaching, right at the end of the pipeline.  The C_SRT part\r
   gives offsets within a single, shared table of closure pointers.\r
 \r