1. 11 Apr, 2011 6 commits
    • Edward Z. Yang's avatar
      Implement mapUFM_Directly. · 856448e1
      Edward Z. Yang authored
      Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
    • Edward Z. Yang's avatar
      Unsafe foreign calls (fat machine instructions) do not kill all registers. · 8a0ab97b
      Edward Z. Yang authored
      The new code generator was doing some interesting spilling across
      unsafe foreign calls:
           _c1ao::I32 = Hp - 4;
           I32[Sp - 20] = _c1ao::I32;
           foreign "ccall"
             newCAF((BaseReg, PtrHint), (R1, PtrHint))[_unsafe_call_];
           _c1ao::I32 = I32[Sp - 20];
      This is fairly unnecessary, and resulted from over-conservative
      liveness analysis from CmmLive.  We can see that the old code
      generator only saved volatile registers across unsafe foreign calls:
      spilling variables was done by saveVolatileVarsAndRegs, which was
      only performed for ordinary calls.
      This commit removes the excess kill from the liveness analysis, as well
      as the *redundant* excess kill from spilling-and-reloading, and adds a
      note to CmmNode to this effect.  The only registers we need to kill
      are the ones that the foreign call assigns to, just like any other
      machine instruction.
      Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
    • Simon Marlow's avatar
      Refactoring and tidy up · 1fb38442
      Simon Marlow authored
      This is a port of some of the changes from my private local-GC branch
      (which is still in darcs, I haven't converted it to git yet).  There
      are a couple of small functional differences in the GC stats: first,
      per-thread GC timings should now be more accurate, and secondly we now
      report average and maximum pause times. e.g. from minimax +RTS -N8 -s:
                                          Tot time (elapsed)  Avg pause  Max pause
        Gen  0      2755 colls,  2754 par   13.16s    0.93s     0.0003s    0.0150s
        Gen  1       769 colls,   769 par    3.71s    0.26s     0.0003s    0.0059s
    • Simon Marlow's avatar
      ghc-pkg dependency on ghc-cabal should be an order-only dependency, · 7bf5bf37
      Simon Marlow authored
      otherwise we repeatedly try to rebuild ghc-pkg if ghc-cabal is newer.
    • Simon Marlow's avatar
      tweak to cleanTempFilesExcept · 61d1a81b
      Simon Marlow authored
    • Simon Marlow's avatar
      add casMutVar# · 521b7925
      Simon Marlow authored
  2. 09 Apr, 2011 4 commits
  3. 08 Apr, 2011 6 commits
    • Ian Lynagh's avatar
      rts/Linker.c tidyups and debug belches · 3783ffa6
      Ian Lynagh authored
      Part of the patch from #5062, from Greg Wright.
    • Ian Lynagh's avatar
      gen_contents_index: Improve parsing of packages file · 159fdb19
      Ian Lynagh authored
      We are now more lenient in parsing the packages file, and
      we don't use any GNUisms. Based on a patch from Matthias Kilian.
    • kgardas's avatar
    • Simon Marlow's avatar
      Force re-linking if the options have changed (#4451) · 814edf44
      Simon Marlow authored
      A common sequence of commands (at least for me) is this:
      $ ghc hello
      1 of 1] Compiling Main             ( hello.hs, hello.o )
      Linking hello ...
      $ ./hello +RTS -s
      hello: Most RTS options are disabled. Link with -rtsopts to enable them.
      $ ghc hello -rtsopts
      grr, nothing happened.  I could use -fforce-recomp, but if this was a
      large program I probably don't want to recompile it all again, so:
      $ rm hello
      removed `hello'
      $ ghc hello -rtsopts
      Linking hello ...
      $ ./hello +RTS -s
      ./hello +RTS -s
      Hello World!
                51,264 bytes allocated in the heap
                 2,904 bytes copied during GC
                43,808 bytes maximum residency (1 sample(s))
                17,632 bytes maximum slop
      With this patch, GHC notices when the options have changed and forces
      a relink, so you don't need to rm the binary or use -fforce-recomp.
      This is done by adding the pertinent stuff to the binary in a special
      section called ".debug-ghc-link-info":
      $ readelf -p .debug-ghc-link-info ./hello
      String dump of section 'ghc-linker-opts':
        [     0]  (["-lHSbase-","-lHSinteger-gmp-","-lgmp","-lHSghc-prim-","-lHSrts","-lm","-lrt","-ldl","-u","ghczmprim_GHCziTypes_Izh_static_info","-u","ghczmprim_GHCziTypes_Czh_static_info","-u","ghczmprim_GHCziTypes_Fzh_static_info","-u","ghczmprim_GHCziTypes_Dzh_static_info","-u","base_GHCziPtr_Ptr_static_info","-u","base_GHCziWord_Wzh_static_info","-u","base_GHCziInt_I8zh_static_info","-u","base_GHCziInt_I16zh_static_info","-u","base_GHCziInt_I32zh_static_info","-u","base_GHCziInt_I64zh_static_info","-u","base_GHCziWord_W8zh_static_info","-u","base_GHCziWord_W16zh_static_info","-u","base_GHCziWord_W32zh_static_info","-u","base_GHCziWord_W64zh_static_info","-u","base_GHCziStable_StablePtr_static_info","-u","ghczmprim_GHCziTypes_Izh_con_info","-u","ghczmprim_GHCziTypes_Czh_con_info","-u","ghczmprim_GHCziTypes_Fzh_con_info","-u","ghczmprim_GHCziTypes_Dzh_con_info","-u","base_GHCziPtr_Ptr_con_info","-u","base_GHCziPtr_FunPtr_con_info","-u","base_GHCziStable_StablePtr_con_info","-u","ghczmprim_GHCziTypes_False_closure","-u","ghczmprim_GHCziTypes_True_closure","-u","base_GHCziPack_unpackCString_closure","-u","base_GHCziIOziException_stackOverflow_closure","-u","base_GHCziIOziException_heapOverflow_closure","-u","base_ControlziExceptionziBase_nonTermination_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnMVar_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnSTM_closure","-u","base_ControlziExceptionziBase_nestedAtomically_closure","-u","base_GHCziWeak_runFinalizzerBatch_closure","-u","base_GHCziTopHandler_runIO_closure","-u","base_GHCziTopHandler_runNonIO_closure","-u","base_GHCziConcziIO_ensureIOManagerIsRunning_closure","-u","base_GHCziConcziSync_runSparks_closure","-u","base_GHCziConcziSignal_runHandlers_closure","-lHSffi"],Nothing,RtsOptsAll,False,[],[])
      And GHC itself uses the readelf command to extract it when deciding
      whether to relink.  The reason for the name ".debug-ghc-link-info" is
      that sections beginning with ".debug" are removed automatically by
      This currently only works on Linux; Windows and OS X still have the
      old behaviour.
    • Ian Lynagh's avatar
      Handle '\r's in boot-pkgs files · e0d60d50
      Ian Lynagh authored
      By default, git will clone in autocrlf mode, which on Windows means
      we get '\r's added to the ghc-packages files.
    • Simon Marlow's avatar
      bugfix for stub generation: create the directory for the _stub.h file, · 9ffa2686
      Simon Marlow authored
      not the _stub.c file, because the latter is now created as a temporary
  4. 07 Apr, 2011 2 commits
  5. 06 Apr, 2011 14 commits
  6. 05 Apr, 2011 8 commits