1. 15 Oct, 2018 20 commits
    • Simon Jakobi's avatar
      Add a strict version of foldMap to Foldable · 172b00c1
      Simon Jakobi authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      Original proposal by Andrew Martin:
      https://mail.haskell.org/pipermail/libraries/2018-June/028852.html
      
      Reviewers: andrewthad, hvr, bgamari, alpmestan, tdammers
      
      Reviewed By: bgamari, alpmestan, tdammers
      
      Subscribers: alpmestan, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4924
      172b00c1
    • davide's avatar
      Update integer_gmp_gcdext documentation. · 45d5eff8
      davide authored and Ben Gamari's avatar Ben Gamari committed
      Reviewers: hvr, bgamari, monoidal
      
      Reviewed By: monoidal
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15350
      
      Differential Revision: https://phabricator.haskell.org/D5091
      45d5eff8
    • Ömer Sinan Ağacan's avatar
      Fix BLACKHOLE inspection in RtClosureInspect · 45ed4619
      Ömer Sinan Ağacan authored and Ben Gamari's avatar Ben Gamari committed
      When inspecing a BLACKHOLE if the BLACKHOLE points to a TSO or a
      BLOCKING_QUEUE we should return a suspension to the BLACKHOLE itself
      (instead of returning a suspension to the indirectee). The reason is
      because in the debugger when we want to evaluate this term we need to
      enter the BLACKHOLE and not to the TSO or BLOCKING_QUEUE. See the
      runtime panic caused by this in #8316.
      
      Note that while with this patch we do the right thing to evaluate
      thunks in GHCi, evaluating thunks that are owned by the evaluator thread
      in a breakpoint will cause a deadlock as we don't release the breakMVar,
      which is what blocks the evaluator thread from continuing with
      evaluation. So the GHCi thread will enter the BLACKHOLE, but owner of
      the BLACKHOLE is also blocked.
      
      Reviewers: simonmar, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #8316
      
      Differential Revision: https://phabricator.haskell.org/D5179
      45ed4619
    • Zejun Wu's avatar
      Allocate bss section within proper range of other sections · 83061413
      Zejun Wu authored and Ben Gamari's avatar Ben Gamari committed
      Allocate bss section within proper range of other sections:
      
      * when `+RTS -xp` is passed, allocate it contiguously as we did for
        jump islands
      * when we mmap the code to lower 2Gb, we should allocate bss section
        there too
      
      This depends on {D5195}
      
      Test Plan:
      1. `./validate`
      
      2.
      
      with
      
      ```
      DYNAMIC_GHC_PROGRAMS = NO
      DYNAMIC_BY_DEFAULT = NO
      ```
      
      `TEST="T15729" make test` passed in both linux and macos.
      
      3.
      
      Also test in a use case where we used to encouter error like:
      
      ```
      ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) =
      b90282ba
      ```
      
      and now, everything works fine.
      
      Reviewers: simonmar, bgamari, angerman, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15729
      
      Differential Revision: https://phabricator.haskell.org/D5219
      83061413
    • Zejun Wu's avatar
      Add a RTS option -xp to load PIC object anywhere in address space · 104599f3
      Zejun Wu authored and Ben Gamari's avatar Ben Gamari committed
      Add a RTS option -xp to load PIC object anywhere in address space. We do
      this by relaxing the requirement of <0x80000000 result of
      `mmapForLinker` and implying USE_CONTIGUOUS_MMAP.
      
      We also need to change calls to `ocInit` and `ocGetNames` to avoid
      dangling pointers when the address of `oc->image` is changed by
      `ocAllocateSymbolExtra`.
      
      Test Plan:
      ```
      $ uname -a
      Linux localhost 4.18.8-arch1-1-ARCH #1 SMP PREEMPT Sat Sep 15 20:34:48
      UTC 2018 x86_64 GNU/Linux
      $ cat mk/build.mk
      DYNAMIC_GHC_PROGRAMS = NO
      DYNAMIC_BY_DEFAULT = NO
      
      GhcRTSWays += thr_debug
      EXTRA_HC_OPTS += -debug
      WAY_p_HC_OPTS += -fPIC -fexternal-dynamic-refs
      $ inplace/bin/ghc-stage2 --interactive -prof +RTS -xp
      GHCi, version 8.7.20180928: http://www.haskell.org/ghc/  :? for help
      ghc-stage2: R_X86_64_32 relocation out of range:
      ghczmprim_GHCziTypes_ZMZN_closure = 7f690bffab59
      Recompile
      /data/users/watashi/ghc/libraries/ghc-prim/dist-install/build/HSghc-prim
      -0.5.3.o with -fPIC -fexternal-dynamic-refs.
      ghc-stage2: unable to load package `ghc-prim-0.5.3'
      $ strace -f -e open,mmap inplace/bin/ghc-stage2 --interactive -prof
      -fexternal-interpreter  -opti+RTS -opti-xp
      ...
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas
      e-4.12.0.0_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84842000
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas
      e-4.12.0.0_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84676000
      ...
      Prelude> System.Posix.Process.getProcessID
      ...
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni
      x-2.7.2.2_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 45056, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d60000
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni
      x-2.7.2.2_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 57344, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d52000
      ...
      ```
      
      ```
      $ uname -a
      Darwin watashis-iMac.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug
      22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
      $ mv
      /Users/watashi/gao/ghc/libraries/integer-gmp/dist-install/build/HSintege
      r-gmp-1.0.2.0.o{,._DISABLE_GHC_ISSUE_15105}
      $ inplace/bin/ghc-stage2 --interactive  +RTS -xp
      GHCi, version 8.7.20181003: http://www.haskell.org/ghc/  :? for help
      Prelude> System.Posix.Process.getProcessID
      42791
      Prelude> Data.Set.fromList [1 .. 10]
      fromList [1,2,3,4,5,6,7,8,9,10]
      Prelude>
      Leaving GHCi.
      $ inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter
      GHCi, version 8.7.20181003: http://www.haskell.org/ghc/  :? for help
      Prelude> System.Posix.Process.getProcessID
      42806
      Prelude> Data.Set.fromList [1 .. 10]
      fromList [1,2,3,4,5,6,7,8,9,10]
      Prelude>
      Leaving GHCi.
      ```
      
      Also test with something that used to hit the 2Gb limit and it loads
      and runs without problem.
      
      Reviewers: simonmar, bgamari, angerman, Phyx, hvr, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5195
      104599f3
    • Vladislav Zavialov's avatar
      Enable -Wcompat=error in the testsuite · 165d3d5d
      Vladislav Zavialov authored and Ben Gamari's avatar Ben Gamari committed
      Enabling -Werror=compat in the testsuite allows us to easily see the
      impact that a new warning has on code. It also means that in the period
      between adding the warning and making the actual breaking change, all
      new test cases that are being added to the testsuite will be
      forwards-compatible. This is good because it will make the actual
      breaking change contain less irrelevant testsuite updates.
      
      Things that -Wcompat warns about are things that are going to break in
      the future, so we can be proactive and keep our testsuite
      forwards-compatible.
      
      This patch consists of two main changes:
      
      * Add `TEST_HC_OPTS += -Werror=compat` to the testsuite configuration.
      * Fix all broken test cases.
      
      Test Plan: Validate
      
      Reviewers: hvr, goldfire, bgamari, simonpj, RyanGlScott
      
      Reviewed By: goldfire, RyanGlScott
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15278
      
      Differential Revision: https://phabricator.haskell.org/D5200
      165d3d5d
    • Peter Trommler's avatar
      ghc-heap: Fix writing closures on big endian · 058c2813
      Peter Trommler authored and Ben Gamari's avatar Ben Gamari committed
      We need to write the closure type as a HalfWord not
      an Int. On big endian systems the closure type ends up being zero
      (the upper word of the Int) making the closure an invalid object.
      
      Test Plan: validate (preferably on a big endian system)
      
      Reviewers: bgamari, hvr, erikd, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5212
      058c2813
    • Zejun Wu's avatar
      Generate correct relocation for external cost centre · 95ec7c88
      Zejun Wu authored and Ben Gamari's avatar Ben Gamari committed
      We used to always generate direct access for cost centre labels.  We
      fixed this by generating indirect data load for cost centre defined in
      external module.
      
      Test Plan:
      The added test used to fail with error message
      ```
      /bin/ld.gold: error: T15723B.o: requires dynamic R_X86_64_PC32 reloc
      against 'T15723A_foo1_EXPR_cc' which may overflow at runtime; recompile
      with -fPIC
      ```
      and now passes.
      
      Also check that `R_X86_64_PC32` is generated for CostCentre from the
      same module and `R_X86_64_GOTPCREL` is generated for CostCentre from
      external module:
      ```
      $ objdump -rdS T15723B.o
      0000000000000028 <T15723B_test_info>:
        28:   48 8d 45 f0             lea    -0x10(%rbp),%rax
        2c:   4c 39 f8                cmp    %r15,%rax
        2f:   72 70                   jb     a1 <T15723B_test_info+0x79>
        31:   48 83 ec 08             sub    $0x8,%rsp
        35:   48 8d 35 00 00 00 00    lea    0x0(%rip),%rsi        # 3c
      <T15723B_test_info+0x14>
                              38: R_X86_64_PC32
      T15723B_test1_EXPR_cc-0x4
        3c:   49 8b bd 60 03 00 00    mov    0x360(%r13),%rdi
        43:   31 c0                   xor    %eax,%eax
        45:   e8 00 00 00 00          callq  4a <T15723B_test_info+0x22>
                              46: R_X86_64_PLT32      pushCostCentre-0x4
        4a:   48 83 c4 08             add    $0x8,%rsp
        4e:   48 ff 40 30             incq   0x30(%rax)
        52:   49 89 85 60 03 00 00    mov    %rax,0x360(%r13)
        59:   48 83 ec 08             sub    $0x8,%rsp
        5d:   49 8b bd 60 03 00 00    mov    0x360(%r13),%rdi
        64:   48 8b 35 00 00 00 00    mov    0x0(%rip),%rsi        # 6b
      <T15723B_test_info+0x43>
                              67: R_X86_64_GOTPCREL   T15723A_foo1_EXPR_cc-0x4
        6b:   31 c0                   xor    %eax,%eax
        6d:   e8 00 00 00 00          callq  72 <T15723B_test_info+0x4a>
                              6e: R_X86_64_PLT32      pushCostCentre-0x4
        72:   48 83 c4 08             add    $0x8,%rsp
        76:   48 ff 40 30             incq   0x30(%rax)
      ```
      
      Reviewers: simonmar, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15723
      
      Differential Revision: https://phabricator.haskell.org/D5214
      95ec7c88
    • Ryan Scott's avatar
      Fix #15738 by defining (and using) parenthesizeHsContext · 02b2116e
      Ryan Scott authored and Ben Gamari's avatar Ben Gamari committed
      With `QuantifiedConstraints`, `forall`s can appear in more
      nested positions than they could before, but `Convert` and the TH
      pretty-printer were failing to take this into account. On the
      `Convert` side, this is fixed by using a `parenthesizeHsContext`
      to parenthesize singleton quantified constraints that appear to the
      left of a `=>`. (A similar fix is applied to the TH pretty-printer.)
      
      Test Plan: make test TEST=T15738
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15738
      
      Differential Revision: https://phabricator.haskell.org/D5222
      02b2116e
    • Ömer Sinan Ağacan's avatar
      Fix cardinality change of fields in addDataConStrictness · c5b477c2
      Ömer Sinan Ağacan authored and Ben Gamari's avatar Ben Gamari committed
      Test Plan: This validates
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5225
      c5b477c2
    • Ryan Scott's avatar
      Fix #12430 by expanding type synonyms in injTyVarsOfType · 26e81e90
      Ryan Scott authored and Ben Gamari's avatar Ben Gamari committed
      We weren't expanding type synonyms when determining the
      injective type variables of a type, leading to certain non-injective
      families being mistakenly labeled as injective (#12430). Easily fixed
      with a tactical use of `coreView`.
      
      Test Plan: make test TEST=T12430
      
      Reviewers: bgamari, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: goldfire, rwbarton, carter
      
      GHC Trac Issues: #12430
      
      Differential Revision: https://phabricator.haskell.org/D5228
      26e81e90
    • Sasa Bogicevic's avatar
      Surprising error message with bang pattern · 0b0cb484
      Sasa Bogicevic authored and Ben Gamari's avatar Ben Gamari committed
      Reviewers: bgamari, alanz
      
      Reviewed By: bgamari
      
      Subscribers: sgraf, mpickering, rwbarton, thomie, carter
      
      GHC Trac Issues: #13600
      
      Differential Revision: https://phabricator.haskell.org/D5040
      0b0cb484
    • Ben Gamari's avatar
      Typeable: Only render saturated tuple types with tuple syntax · 846fe904
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      This isn't as efficient as it could be since it needs to compute the
      kind of the type. However, this is `show` so there shouldn't be any
      particular expectation of speed.
      
      Fixes #14341.
      
      Test Plan: Validate
      
      Reviewers: hvr
      
      Subscribers: monoidal, rwbarton, carter
      
      GHC Trac Issues: #14341
      
      Differential Revision: https://phabricator.haskell.org/D5080
      846fe904
    • Krzysztof Gogolewski's avatar
      Cleanup boot and validate · a816ac48
      Krzysztof Gogolewski authored and Ben Gamari's avatar Ben Gamari committed
      - Remove dph from validate; dph was removed
      - The required-tag argument to boot was used only for dph, remove
      - check_boot_packages() was not called at all, and didn't work.
        I fixed it based on previous Perl version.
      
      Test Plan: Harbormaster
      
      Reviewers: bgamari, thomie
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5129
      a816ac48
    • Tamar Christina's avatar
      Fix plugin tests requirements · 01c3d00a
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      Unfortunately the implementation has confused the ability to make
      dynamic libraries with dynamic way.
      This constraint is only true for systems that require `-fPIC` for
      shared libraries.
      
      Since the implementation has this implicit assumption, mark the tests
      as requiring dynway.
      
      Test Plan: ./validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: simonpj, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5174
      01c3d00a
    • Ben Gamari's avatar
      Deprecate -fllvm-pass-vectors-in-regs · 58dffa0a
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      The behavior previously enabled by this flag is as been the default
      since 8.6.1.
      
      Reviewers: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5193
      58dffa0a
    • Nathan van Doorn's avatar
      f945b7ab
    • Ondra Pelech's avatar
      8a9a63be
    • Tobias Dammers's avatar
      Use an accumulator version of tyCoVarsOfType · 08b3db7e
      Tobias Dammers authored and Krzysztof Gogolewski's avatar Krzysztof Gogolewski committed
      Summary:
      This is part 1 from #14880: factor out a worker for the tyCoVarsOf... family of
      function, implementing them in terms of VarSet, but with accumulator-style
      (like in `FV`) built in, and with the same kind of pre-insert lookup; this
      has shown to perform better than either FV or plain VarSet in this particular
      scenario.
      
      Original notes from simonpj:
      
      In TyCoRep we now have tyCoVarsOfType implemented
      
      1) Using FV -- this is the baseline version in GHC today
      
      2) Using VarSets via unionVarSet
      
      3) Using VarSets in accumulator-style
      
      In this patch (3) is enabled.
      
      When compiling perf/compiler/T5631 we get
      
               Compiler allocs
         (1)   1,144M
         (2)   1,175M
         (3)   1,142M
      
      The key new insight in (3) is this:
      
        ty_co_vars_of_type (TyVarTy v) is acc
          | v `elemVarSet` is  = acc
          | v `elemVarSet` acc = acc   <---- NB!
          | otherwise          = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v)
      
      Notice the second line! If the variable is already in the
      accumulator, don't re-add it.  This makes big difference.
      Without it, allocation is 1,169M or so.
      
      One cause is that we only take the free vars of its kind once;
      that problem will go away when we do the main part of #14088 and
      close over kinds /afterwards/.  But still, another cause is perhaps
      that every insert into a set overwrites the previous item, and so
      allocates a new path to the item; it's not a no-op even if the
      item is there already.
      
      Why use (3) rather than (1)?  Becuase it just /has/ to
      be better;
      
      * FV carries around an InterestingVarFun, which does nothing
        useful here, but is tested at every variable
      
      * FV carries around a [Var] for the deterministic version.
      
      For this very hot operation (finding free vars) I think it
      makes sense to have speical purpose code.
      
      On the way I also simplified the (less used) coVarsOfType/Co family
      to use FV, by making serious use of the InterestingVarFun!
      
      Test Plan: validate, nofib
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #14880
      
      Differential Revision: https://phabricator.haskell.org/D5141
      08b3db7e
    • Ryan Scott's avatar
      Fix #15725 with an extra Sym · 48efbc04
      Ryan Scott authored and Krzysztof Gogolewski's avatar Krzysztof Gogolewski committed
      Summary:
      We were adding a `Sym` to one argument in the `InstCo`
      case of `optCoercion` but not another, leading to the two arguments
      to misaligned when combined via `Trans`. This fixes the issue with
      a well targeted use of `wrapSym`.
      
      Test Plan: make test TEST=T15725
      
      Reviewers: goldfire, ningning, bgamari
      
      Reviewed By: goldfire, ningning
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15725
      
      Differential Revision: https://phabricator.haskell.org/D5217
      48efbc04
  2. 14 Oct, 2018 4 commits
  3. 12 Oct, 2018 3 commits
  4. 11 Oct, 2018 1 commit
    • Piyush P Kurur's avatar
      Support builtin classes like KnownNat in backpack · ce7a1c4a
      Piyush P Kurur authored and Ben Gamari's avatar Ben Gamari committed
      This commit allows backpack signatures to enforce constraints like
      KnownNat
      on data types.  Thus it fixes #15379.  There were two important
      differences in the
      way GHC used to handle classes like KnowNat
      
      1.  Hand crafted instances of `KnownNat` were  forbidden, and
      
      2. The dictionary for an  instance `KnownNat T` was generated on the
      fly.
      
      For supporting backpack both these points have to be revisited.
      
      Disallowing instances of KnownNat
      --------------------------------------------
      
      Users were disallowed to declare instances of certain builtin classes
      like KnownNat for obvious safety reasons --- when we use the
      constraint like `KnownNat T`, we want T to be associated to a natural
      number. However, due to the reuse of this code while processing backpack
      signatures, `instance KnownNat T` were being disallowed even in module
      signature files.
      
      There is an important difference when it comes to instance declarations
      in a signature file. Consider the signature `Abstract` given below
      
      ```
      signature Abstract where
        data T :: Nat
        instance KnownNat T
      
      ```
      
      Inside a signature like `Abstract`, the `instance Known T` is not really
      creating an instance but rather demanding any module that implements
      this signature to enforce the constraint `KnownNat` on its type
      T.  While hand crafted KnownNat instances continued to be prohibited in
      modules,
      this commit ensures that it is not forbidden while handling signatures.
      
      Resolving Dictionaries
      ----------------------------
      
      Normally GHC expects any instance `T` of class `KnownNat` to eventually
      resolve
      to an integer and hence used to generate the evidence/dictionary for
      such instances
      on the fly as in when it is required. However, when backpack module and
      signatures are involved
      It is not always possible to resolve the type to a concrete integer
      utill the mixin stage. To illustrate
      consider again the  signature `Abstract`
      
      > signature Abstract where
      >   data T :: Nat
      >   instance KnownNat T
      
      and a module `Util` that depends on it:
      
      > module Util where
      >     import Abstract
      >     printT :: IO ()
      >     printT = do print $ natVal (Proxy :: Proxy T)
      
      Clearly, we need to "use" the dictionary associated with `KnownNat T`
      in the module `Util`, but it is too early for the compiler to produce
      a real dictionary as we still have not fixed what `T` is. Only when we
      mixin a concrete module
      
      > module Concrete where
      >   type T = 42
      
      do we really get hold of the underlying integer.
      
      In this commit, we make the following changes in the resolution of
      instance dictionary
      for constraints like `KnownNat T`
      
      1. If T is indeed available as a type alias for an integer constant,
         generate the dictionary on the fly as before, failing which
      
      2. Do not give up as before but look up the type class environment for
      the evidence.
      
      This was enough to make the resolution of `KnownNat` dictionaries work
      in the setting of Backpack as
      when actual code is generated, the signature Abstract (due to the
      `import Abstract` ) in `Util` gets
      replaced by an actual module like Concrete, and resolution happens as
      before.
      
      Everything that we said for `KnownNat` is applicable for `KnownSymbol`
      as well.
      
      Reviewers: bgamari, ezyang, goldfire, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, ezyang, rwbarton, thomie, carter
      
      GHC Trac Issues: #15379
      
      Differential Revision: https://phabricator.haskell.org/D4988
      ce7a1c4a
  5. 10 Oct, 2018 2 commits
    • Ömer Sinan Ağacan's avatar
      Re-enable test T14251 · 2f693b3e
      Ömer Sinan Ağacan authored
      (This change was accidentally reverted with the previous commit)
      2f693b3e
    • Ömer Sinan Ağacan's avatar
      Fix dataToTag# argument evaluation · ac977688
      Ömer Sinan Ağacan authored
      See #15696 for more details. We now always enter dataToTag# argument (done in
      generated Cmm, in StgCmmExpr). Any high-level optimisations on dataToTag#
      applications are done by the simplifier. Looking at tag bits (instead of
      reading the info table) for small types is left to another diff.
      
      Incorrect test T14626 is removed. We no longer do this optimisation (see
      comment:44, comment:45, comment:60).
      
      Comments and notes about special cases around dataToTag# are removed. We no
      longer have any special cases around it in Core.
      
      Other changes related to evaluating primops (seq# and dataToTag#) will be
      pursued in follow-up diffs.
      
      Test Plan: Validates with three regression tests
      
      Reviewers: simonpj, simonmar, hvr, bgamari, dfeuer
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15696
      
      Differential Revision: https://phabricator.haskell.org/D5201
      ac977688
  6. 09 Oct, 2018 2 commits
  7. 07 Oct, 2018 5 commits
  8. 06 Oct, 2018 2 commits
    • Sergei Trofimovich's avatar
      UNREG: don't prefix asm prefixes in via-C mode · 4e3562c0
      Sergei Trofimovich authored
      commit 64c54fff
      
      
      ("Mark system and internal symbols as private symbols in asm")
      
      Added `internalNamePrefix` helper. Unfortunately it
      generates invalid label in unregisterised mode:
      
      ```
      $ ./configure --enable-unregisterised
      /tmp/ghc19372_0/ghc_4.hc:2831:22: error:
           error: expected identifier or '(' before '.' token
           static const StgWord .Lcl3_info[]__attribute__((aligned(8)))= {
                                ^
      ```
      
      Here asm-style prefix is applied to C symbol.
      The fix is simple: apply asm-style labels only to assembly code.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Reviewers: simonmar, last_g, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5207
      4e3562c0
    • Ömer Sinan Ağacan's avatar
      Add a missing write barrier to small array writes · 8be27c03
      Ömer Sinan Ağacan authored
      Write barriers for large array writes were added in D2525, as a part of #12469.
      However it seems we forgot about small arrays. This patch adds the same write
      barrier to small array writes.
      
      Reviewers: simonmar, bgamari
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #12469
      
      Differential Revision: https://phabricator.haskell.org/D5209
      8be27c03
  9. 05 Oct, 2018 1 commit
    • David Feuer's avatar
      Stable name type role · 22872574
      David Feuer authored and Ben Gamari's avatar Ben Gamari committed
      Make the `StableName#` parameter phantom:
      
      There is actually never any reason to care about the type of
      the underlying object of a `StableName#`. The underlying object
      type shouldn't really even *be* a parameter. But at least we
      can mark it as phantom.
      
      Reviewers: hvr, bgamari, erikd, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: ekmett, rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5117
      22872574