Changes between Version 26 and Version 27 of Commentary/Compiler/NewCodeGenStupidity


Ignore:
Timestamp:
Apr 27, 2011 10:47:29 AM (3 years ago)
Author:
ezyang
Comment:

more stuff

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/NewCodeGenStupidity

    v26 v27  
    386386} 
    387387}}} 
     388 
     389== Noppy proc-points == 
     390 
     391Consider 
     392 
     393{{{ 
     394f :: Int -> Int -> Int -> Int 
     395f a b c 
     396    = let x = a + b 
     397          y = b + c 
     398          z = a + c 
     399      in x `seq` case g x y z of 
     400            True  -> x 
     401            False -> 0 
     402 
     403{-# NOINLINE g #-} 
     404g :: Int -> Int -> Int -> Bool 
     405g x y 0 = x == y 
     406g _ _ _ = False 
     407}}} 
     408 
     409{{{ 
     410      cnm: 
     411          // directEntry else 
     412          // emitCall: Sequel: Assign 
     413          I32[(young<cmM> + 8)] = base_GHCziNum_zdfNumInt_closure; 
     414          I32[(young<cmM> + 4)] = cmM; 
     415          call base_GHCziNum_zp_info(...) returns to Just cmM (8) (4) with update frame 4; 
     416      cmM: 
     417          _cmN::I32 = R1; 
     418          // slow_call for _cmN::I32 with pat stg_ap_pp 
     419          R1 = _cmN::I32; 
     420          // emitCall: Sequel: Assign 
     421          I32[(young<cmP> + 8)] = _skO::I32; 
     422          I32[(young<cmP> + 12)] = _skN::I32; 
     423          I32[(young<cmP> + 4)] = cmP; 
     424          call stg_ap_pp_fast(...) returns to Just cmP (12) (4) with update frame 4; 
     425}}} 
     426 
     427We generate an extra proc-point for ``cmM``, where in theory we ought to be able to stick the subsequent ``stg_ap_pp_fast`` onto the stack as another return point.