Changes between Version 24 and Version 25 of Commentary/Compiler/NewCodeGenStupidity


Ignore:
Timestamp:
Apr 27, 2011 9:53:20 AM (3 years ago)
Author:
ezyang
Comment:

SPJ was right!

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/NewCodeGenStupidity

    v24 v25  
    253253}}} 
    254254 
    255 == Double temp-use == 
     255== Double temp-use means no inlinining? == 
    256256 
    257257 
     
    279279 
    280280Actually, I think this is a case of spill/reload silliness. 
     281 
     282== Stupid spills == 
     283 
     284If something is already in memory, why do we have to spill it again? Well, it's because the spiller isn't clever enough: 
     285 
     286{{{ 
     287  cs3: 
     288      _smw::I32 = I32[(old + 8)]; 
     289      I32[(slot<_smw::I32> + 4)] = _smw::I32; 
     290      _smv::I32 = I32[(old + 12)]; 
     291      I32[(slot<_smv::I32> + 4)] = _smv::I32; 
     292      _smu::I32 = I32[(old + 16)]; 
     293      I32[(slot<_smu::I32> + 4)] = _smu::I32; 
     294      _smt::I32 = I32[(old + 20)]; 
     295      I32[(slot<_smt::I32> + 4)] = _smt::I32; 
     296      _sms::I32 = I32[(old + 24)]; 
     297      I32[(slot<_sms::I32> + 4)] = _sms::I32; 
     298      _smr::I32 = I32[(old + 28)]; 
     299      I32[(slot<_smr::I32> + 4)] = _smr::I32; 
     300      _smq::I32 = I32[(old + 32)]; 
     301      I32[(slot<_smq::I32> + 4)] = _smq::I32; 
     302      _smn::I32 = I32[(old + 36)]; 
     303      I32[(slot<_smn::I32> + 4)] = _smn::I32; 
     304      _smm::I32 = I32[(old + 40)]; 
     305      I32[(slot<_smm::I32> + 4)] = _smm::I32; 
     306      if (Sp - <highSp> < SpLim) goto cs9; else goto cs5; 
     307  cs5: 
     308      // outOfLine should follow: 
     309      // directEntry else 
     310      // emitCall: Sequel: Assign 
     311      I32[(young<crz> + 8)] = _smn::I32; 
     312      I32[(young<crz> + 12)] = _smm::I32; 
     313      I32[(young<crz> + 4)] = crz; 
     314      call Foo.baz_info(...) returns to Just crz (12) (4) with update frame 4; 
     315  crz: 
     316      _smm::I32 = I32[(slot<_smm::I32> + 4)]; 
     317      _smn::I32 = I32[(slot<_smn::I32> + 4)]; 
     318      _smq::I32 = I32[(slot<_smq::I32> + 4)]; 
     319      _smr::I32 = I32[(slot<_smr::I32> + 4)]; 
     320      _sms::I32 = I32[(slot<_sms::I32> + 4)]; 
     321      _smt::I32 = I32[(slot<_smt::I32> + 4)]; 
     322      _smu::I32 = I32[(slot<_smu::I32> + 4)]; 
     323      _smv::I32 = I32[(slot<_smv::I32> + 4)]; 
     324      _smw::I32 = I32[(slot<_smw::I32> + 4)]; 
     325      _smx::I32 = R1; 
     326      I32[(slot<_smx::I32> + 4)] = _smx::I32; 
     327      _csp::I32 = _smx::I32 & 3; 
     328      if (_csp::I32 >= 2) goto csk; else goto usu; 
     329}}} 
     330 
     331Ick!