Changes between Version 1 and Version 2 of Internships/JanStolarek


Ignore:
Timestamp:
Jul 5, 2013 10:47:04 AM (10 months ago)
Author:
jstolarek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Internships/JanStolarek

    v1 v2  
    11= Jan Stolarek's internship notes = 
     2 
     3= Various clean-up tasks = 
     4== Code == 
     5  * `main/HscMain.lhs:1300``. Is: 
     6 
     7{{{ 
     8| otherwise 
     9  = {-# SCC "cmmPipeline" #-} 
     10    let initTopSRT = initUs_ us emptySRT in 
     11 
     12    let run_pipeline topSRT cmmgroup = do 
     13          (topSRT, cmmgroup) <- cmmPipeline hsc_env topSRT cmmgroup 
     14          return (topSRT,cmmgroup) 
     15 
     16    in do topSRT <- Stream.mapAccumL run_pipeline initTopSRT ppr_stream1 
     17          Stream.yield (srtToData topSRT) 
     18}}} 
     19 
     20The `<- / return` sequence in the definition of `run_pipeline` can be eliminated, which allows to remove the `do` notation, which allows to do eta-reduction, which (finally) allows to remove the `run_pipeline` binding and using `(cmmPipeline hsc_env)` instead: 
     21 
     22{{{ 
     23| otherwise 
     24  = {-# SCC "cmmPipeline" #-} 
     25    let initTopSRT = initUs_ us emptySRT 
     26    in do topSRT <- Stream.mapAccumL (cmmPipeline hsc_env) initTopSRT ppr_stream1 
     27          Stream.yield (srtToData topSRT) 
     28}}} 
     29 
     30  * `cmm/CmmLive.hs:106`. This function is not used (unless there is some auto-generated code that uses it, but I doubt it): 
     31 
     32{{{ 
     33removeDeadAssignments :: DynFlags -> CmmGraph 
     34                      -> UniqSM (CmmGraph, BlockEnv CmmLocalLive) 
     35}}} 
     36It is however referenced in some of the comments! 
     37 
     38  * `cmm/CmmRewriteAssignments.hs` is not used at all? 
     39  * `cmm/CmmUtils.hs`, function `toBlockListEntryFirst` - perhaps it would be safer to return a tuple in this case? This would probably make the invariant more explicit. 
     40 
     41== Wiki ==