Skip to content
Snippets Groups Projects
  1. Jul 19, 2019
  2. Jul 17, 2019
    • Sebastian Graf's avatar
      Make GHC-in-GHCi work on Windows · 8add024f
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      By not building anything in the dynamic way on Windows, where we don't
      have a working story for DLLs yet.
      
      Also the ghcid command needs to call bash on the hadrian/ghci.sh script
      explicitly as the path gets interpreted differently otherwise.
      8add024f
    • John Ericson's avatar
      Create {Int,Word}32Rep · 0a9b77b8
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      This prepares the way for making Int32# and Word32# the actual size they
      claim to be.
      
      Updates binary submodule for (de)serializing the new runtime reps.
      0a9b77b8
  3. Jul 16, 2019
  4. Jul 15, 2019
  5. Jul 14, 2019
  6. Jul 13, 2019
    • Ömer Sinan Ağacan's avatar
      Minor refactoring in CmmBuildInfoTables · a7176fa1
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      - Replace `catMaybes (map ...)` with `mapMaybe ...`
      - Remove a list->set->list conversion
      a7176fa1
    • Jess's avatar
    • Andreas Klebinger's avatar
      Add two CmmSwitch optimizations. · 348cc8eb
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      Move switch expressions into a local variable when generating switches.
      This avoids duplicating the expression if we translate the switch
      to a tree search. This fixes #16933.
      
      Further we now check if all branches of a switch have the same
      destination, replacing the switch with a direct branch if that
      is the case.
      
      Both of these patterns appear in the ENTER macro used by the RTS
      but are unlikely to occur in intermediate Cmm generated by GHC.
      
      Nofib result summary:
      
      --------------------------------------------------------------------------------
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
      --------------------------------------------------------------------------------
                  Min          -0.0%     -0.0%    -15.7%    -15.6%      0.0%
                  Max          -0.0%      0.0%     +5.4%     +5.5%      0.0%
       Geometric Mean          -0.0%     -0.0%     -1.0%     -1.0%     -0.0%
      
      Compiler allocations go up slightly: +0.2%
      
      Example output before and after the change taken from RTS code below.
      
      All but one of the memory loads `I32[_c3::I64 - 8]` are eliminated.
      Instead the data is loaded once from memory in block c6.
      
      Also the switch in block `ud` in the original code has been
      eliminated completely.
      
      Cmm without this commit:
      
      ```
      stg_ap_0_fast() { //  [R1]
              { []
              }
          {offset
            ca: _c1::P64 = R1;   // CmmAssign
                goto c2;   // CmmBranch
            c2: if (_c1::P64 & 7 != 0) goto c4; else goto c6;
            c6: _c3::I64 = I64[_c1::P64];
                if (I32[_c3::I64 - 8] < 26 :: W32) goto ub; else goto ug;
            ub: if (I32[_c3::I64 - 8] < 15 :: W32) goto uc; else goto ue;
            uc: if (I32[_c3::I64 - 8] < 8 :: W32) goto c7; else goto ud;
            ud: switch [8 .. 14] (%MO_SS_Conv_W32_W64(I32[_c3::I64 - 8])) {
                    case 8, 9, 10, 11, 12, 13, 14 : goto c4;
                }
            ue: if (I32[_c3::I64 - 8] >= 25 :: W32) goto c4; else goto uf;
            uf: if (%MO_SS_Conv_W32_W64(I32[_c3::I64 - 8]) != 23) goto c7; else goto c4;
            c4: R1 = _c1::P64;
                call (P64[Sp])(R1) args: 8, res: 0, upd: 8;
            ug: if (I32[_c3::I64 - 8] < 28 :: W32) goto uh; else goto ui;
            uh: if (I32[_c3::I64 - 8] < 27 :: W32) goto c7; else goto c8;
            ui: if (I32[_c3::I64 - 8] < 29 :: W32) goto c8; else goto c7;
            c8: _c1::P64 = P64[_c1::P64 + 8];
                goto c2;
            c7: R1 = _c1::P64;
                call (_c3::I64)(R1) args: 8, res: 0, upd: 8;
          }
      }
      ```
      
      Cmm with this commit:
      
      ```
      stg_ap_0_fast() { //  [R1]
              { []
              }
          {offset
            ca: _c1::P64 = R1;
                goto c2;
            c2: if (_c1::P64 & 7 != 0) goto c4; else goto c6;
            c6: _c3::I64 = I64[_c1::P64];
                _ub::I64 = %MO_SS_Conv_W32_W64(I32[_c3::I64 - 8]);
                if (_ub::I64 < 26) goto uc; else goto uh;
            uc: if (_ub::I64 < 15) goto ud; else goto uf;
            ud: if (_ub::I64 < 8) goto c7; else goto c4;
            uf: if (_ub::I64 >= 25) goto c4; else goto ug;
            ug: if (_ub::I64 != 23) goto c7; else goto c4;
            c4: R1 = _c1::P64;
                call (P64[Sp])(R1) args: 8, res: 0, upd: 8;
            uh: if (_ub::I64 < 28) goto ui; else goto uj;
            ui: if (_ub::I64 < 27) goto c7; else goto c8;
            uj: if (_ub::I64 < 29) goto c8; else goto c7;
            c8: _c1::P64 = P64[_c1::P64 + 8];
                goto c2;
            c7: R1 = _c1::P64;
                call (_c3::I64)(R1) args: 8, res: 0, upd: 8;
          }
      }
      ```
      348cc8eb
    • Alp Mestanogullari's avatar
      compiler: trace SysTools commands to emit start/stop eventlog markers · 688a1b89
      Alp Mestanogullari authored and Marge Bot's avatar Marge Bot committed
      This patch was motivated by some performance characterization work done
      for #16822, where we suspected that GHC was spending a lot of time waiting
      on the linker to be done. (That turned out to be true.)
      
      The tracing is taken care of by ErrUtils.withTiming, so this patch just defines
      and uses a little wrapper around that function in all the helpers for
      calling the various systools (C compiler, linker, unlit, ...).
      
      With this patch, assuming a GHC executable linked against an eventlog-capable
      RTS (RTS ways that contain the debug, profiling or eventlog way units), we can
      measure how much time is spent in each of the SysTools when building hello.hs
      by simply doing:
      
        ghc hello.hs -ddump-timings +RTS -l
      
      The event names are "systool:{cc, linker, as, unlit, ...}".
      688a1b89
    • Ashley Yakeley's avatar
      base: Data.Fixed: make HasResolution poly-kinded (#10055, #15622) · a31b24a5
      Ashley Yakeley authored and Marge Bot's avatar Marge Bot committed
      a31b24a5
  7. Jul 12, 2019
    • Shayne Fletcher's avatar
      Add shake 0.18.3 to extra deps · de3935a6
      Shayne Fletcher authored and Marge Bot's avatar Marge Bot committed
      de3935a6
    • Simon Peyton Jones's avatar
      Fix kind-checking for data/newtypes · e4c73514
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      In one spot in kcConDecl we were passing in the return
      kind signature rether than the return kind. e.g. #16828
      
         newtype instance Foo :: Type -> Type where
           MkFoo :: a -> Foo a
      
      We were giving kcConDecl the kind (Type -> Type), whereas it
      was expecting the ultimate return kind, namely Type.
      
      This "looking past arrows" was being done, independently,
      in several places, but we'd missed one.  This patch moves it all
      to one place -- the new function kcConDecls (note the plural).
      
      I also took the opportunity to rename
        tcDataFamHeader  to   tcDataFamInstHeader
      
      (The previous name was consistently a source of confusion.)
      e4c73514
  8. Jul 11, 2019
  9. Jul 10, 2019
    • Simon Peyton Jones's avatar
      Fix erroneous float in CoreOpt · d2e290d3
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      The simple optimiser was making an invalid transformation
      to join points -- yikes.  The fix is easy.
      
      I also added some documentation about the fact that GHC uses
      a slightly more restrictive version of join points than does
      the paper.
      
      Fix #16918
      d2e290d3
    • Ben Gamari's avatar
      hadrian/doc: Add some discussion of compilation stages · a35e0916
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This documents some of the lore surrounding the nature and naming of
      GHC's stage numbers.
      a35e0916
    • Eric Wolf's avatar
      T16804: adjust src spans · 8fcc931c
      Eric Wolf authored and Marge Bot's avatar Marge Bot committed
      8fcc931c
    • Eric Wolf's avatar
      Add testcase T16804 for #16804 · 85da17e5
      Eric Wolf authored and Marge Bot's avatar Marge Bot committed
      slightly larger testcase for :type-at and :uses
      so we can see changes, if #16804 is done.
      85da17e5
    • Ömer Sinan Ağacan's avatar
      Minor refactoring in CoreSimpl · 897a59a5
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      When `join_ids` is empty `extendVarSetList existing_joins join_ids` is
      already no-op, so no need to check whether `join_ids` is empty or not
      before extending the joins set.
      897a59a5
    • Ömer Sinan Ağacan's avatar
      Testsuite tweaks and refactoring · d7423f10
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      - Rename requires_th to req_th for consistency with other req functions
        (e.g. req_interp, req_profiling etc.)
      
      - req_th (previously requires_th) now checks for interpreter (via
        req_interp). With this running TH tests are skipped when running the
        test suite with stage=1.
      
      - Test tweaks:
          - T9360a, T9360b: Use req_interp
          - recomp009, T13938, RAE_T32a: Use req_th
      
      - Fix check-makefiles linter: it now looks for Makefiles instead of .T
        files (which are actually Python files)
      d7423f10
    • Alp Mestanogullari's avatar
      Hadrian: fix source-dist rule · 7f8bf98e
      Alp Mestanogullari authored and Marge Bot's avatar Marge Bot committed
      The first problem was that the list of files/dirs to embed or ignore was not
      up-to-date. The second problem was that the 'Cwd' option used when running the
      Tar builder in the source-dist rule didn't actually change the current directory
      and was therefore failing. Finally, the source-dist rule did not pre-generate
      Haskell modules derived from .x (alex) and .y (happy) files, like the Make
      build system does -- this is now fixed.
      
      We might be doing too much work for that last step (we seem to be building
      many things until we get to generating the source distribution), but extracting
      the distribution and running
      
          ./configure && hadrian/build.sh --flavour=quickest -j
      
      from there does work for me now.
      7f8bf98e
Loading