Changes between Version 4 and Version 5 of Internships/JanStolarek


Ignore:
Timestamp:
Jul 5, 2013 11:15:05 AM (10 months ago)
Author:
jstolarek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Internships/JanStolarek

    v4 v5  
    1818 
    1919= Various clean-up tasks = 
    20 == Code == 
     20== Cleaning up the STG ->Cmm pass == 
     21When generating Cmm from STG there is some SRT information being generated (only for CAFS?). It is not used and has to be rebuilt anyway after converting to CPS Cmm. Below are some random notes and pieces of code that might related to this: 
     22   
     23  * Cmm conversions in the compiler pipeline: `main/HscMain.hs` has `tryNewCodeGen` (l. 1300), which first calls `StgCmm.codegen` and then passes the generated Cmm to `cmmPipeline` function from `cmm/CmmPipeline.hs`. According to Austin Seipp `cpsTop` in `cmm/CmmPipeline.hs` takes care of converting to CPS: "yeah, CmmPipeline does take care of it. it's partially cpsTop that does it, and doSRTs elaborates the top-level info tables and stuff beyond that but mostly cpsTop. i think your general turning point is after the stack layout and stack pointer manifestation".  
     24 
     25This code in `cmm/Cmm.hs` that might be relevant (or not): 
     26 
     27{{{ 
     28-- (line 141 and onwards) 
     29-- | Info table as a haskell data type 
     30data CmmInfoTable 
     31  = CmmInfoTable { 
     32      cit_lbl  :: CLabel, -- Info table label 
     33      cit_rep  :: SMRep, 
     34      cit_prof :: ProfilingInfo, 
     35      cit_srt  :: C_SRT 
     36    } 
     37 
     38data ProfilingInfo 
     39  = NoProfilingInfo 
     40  | ProfilingInfo [Word8] [Word8] -- closure_type, closure_desc 
     41 
     42-- C_SRT is what StgSyn.SRT gets translated to... 
     43-- we add a label for the table, and expect only the 'offset/length' form 
     44 
     45data C_SRT = NoC_SRT 
     46           | C_SRT !CLabel !WordOff !StgHalfWord {-bitmap or escape-} 
     47           deriving (Eq) 
     48 
     49needsSRT :: C_SRT -> Bool 
     50needsSRT NoC_SRT       = False 
     51needsSRT (C_SRT _ _ _) = True 
     52}}} 
     53 
     54 
     55== Random code == 
    2156  * `main/HscMain.lhs:1300``. Is: 
    2257 
     
    5994  * [wiki:Commentary/Compiler/NewCodeGenPipeline NewCodeGenPipeline] has some outdated sections in the Cmm pipeline description: Add spill/reload, Rewrite assignments. So far I only marked them as OUTDATED 
    6095  * [wiki:Commentary/Compiler/NewCodeGenModules NewCodeGenModules] - mostly outdated. Mentioned data types and modules no longer exist. 
     96 
     97= Various stuff = 
     98Some LLVM notes that may be useful: 
     99  - [wiki:Commentary/Compiler/Backends/LLVM/Alias LLVM Alias Notes] 
     100  - [http://blog.davidterei.com/2011/09/ghc-project-for-all.html David Terei's LLVM blog post] 
     101  - [http://blog.omega-prime.co.uk/?p=135 Mac Bolingbroke's LLVM blog entry]