Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/ghc
  • bgamari/ghc
  • syd/ghc
  • ggreif/ghc
  • watashi/ghc
  • RolandSenn/ghc
  • mpickering/ghc
  • DavidEichmann/ghc
  • carter/ghc
  • harpocrates/ghc
  • ethercrow/ghc
  • mijicd/ghc
  • adamse/ghc
  • alexbiehl/ghc
  • gridaphobe/ghc
  • trofi/ghc
  • supersven/ghc
  • ppk/ghc
  • ulysses4ever/ghc
  • AndreasK/ghc
  • ghuntley/ghc
  • shayne-fletcher-da/ghc
  • fgaz/ghc
  • yav/ghc
  • osa1/ghc
  • mbbx6spp/ghc
  • JulianLeviston/ghc
  • reactormonk/ghc
  • rae/ghc
  • takenobu-hs/ghc
  • michalt/ghc
  • andrewthad/ghc
  • hsyl20/ghc
  • scottgw/ghc
  • sjakobi/ghc
  • angerman/ghc
  • RyanGlScott/ghc
  • hvr/ghc
  • howtonotwin/ghc
  • chessai/ghc
  • m-renaud/ghc
  • brprice/ghc
  • stevehartdata/ghc
  • sighingnow/ghc
  • kgardas/ghc
  • ckoparkar/ghc
  • alp/ghc
  • smaeul/ghc
  • kakkun61/ghc
  • sykloid/ghc
  • newhoggy/ghc
  • toonn/ghc
  • nineonine/ghc
  • Phyx/ghc
  • ezyang/ghc
  • tweag/ghc
  • langston/ghc
  • ndmitchell/ghc
  • rockbmb/ghc
  • artempyanykh/ghc
  • mniip/ghc
  • mynguyenbmc/ghc
  • alexfmpe/ghc
  • crockeea/ghc
  • nh2/ghc
  • vaibhavsagar/ghc
  • phadej/ghc
  • Haskell-mouse/ghc
  • lolotp/ghc
  • spacekitteh/ghc
  • michaelpj/ghc
  • mgsloan/ghc
  • HPCohen/ghc
  • tmobile/ghc
  • radrow/ghc
  • simonmar/ghc
  • _deepfire/ghc
  • Ericson2314/ghc
  • leitao/ghc
  • fumieval/ghc
  • trac-isovector/ghc
  • cblp/ghc
  • xich/ghc
  • ciil/ghc
  • erthalion/ghc
  • xldenis/ghc
  • autotaker/ghc
  • haskell-wasm/ghc
  • kcsongor/ghc
  • agander/ghc
  • Baranowski/ghc
  • trac-dredozubov/ghc
  • 23Skidoo/ghc
  • iustin/ghc
  • ningning/ghc
  • josefs/ghc
  • kabuhr/ghc
  • gallais/ghc
  • dten/ghc
  • expipiplus1/ghc
  • Pluralia/ghc
  • rohanjr/ghc
  • intricate/ghc
  • kirelagin/ghc
  • Javran/ghc
  • DanielG/ghc
  • trac-mizunashi_mana/ghc
  • pparkkin/ghc
  • bollu/ghc
  • ntc2/ghc
  • jaspervdj/ghc
  • JoshMeredith/ghc
  • wz1000/ghc
  • zkourouma/ghc
  • code5hot/ghc
  • jdprice/ghc
  • tdammers/ghc
  • J-mie6/ghc
  • trac-lantti/ghc
  • ch1bo/ghc
  • cgohla/ghc
  • lucamolteni/ghc
  • acairncross/ghc
  • amerocu/ghc
  • chreekat/ghc
  • txsmith/ghc
  • trupill/ghc
  • typetetris/ghc
  • sergv/ghc
  • fryguybob/ghc
  • erikd/ghc
  • trac-roland/ghc
  • setupminimal/ghc
  • Friede80/ghc
  • SkyWriter/ghc
  • xplorld/ghc
  • abrar/ghc
  • obsidiansystems/ghc
  • Icelandjack/ghc
  • adinapoli/ghc
  • trac-matthewbauer/ghc
  • heatsink/ghc
  • dwijnand/ghc
  • Cmdv/ghc
  • alinab/ghc
  • pepeiborra/ghc
  • fommil/ghc
  • luochen1990/ghc
  • rlupton20/ghc
  • applePrincess/ghc
  • lehins/ghc
  • ronmrdechai/ghc
  • leeadam/ghc
  • harendra/ghc
  • mightymosquito1991/ghc
  • trac-gershomb/ghc
  • lucajulian/ghc
  • Rizary/ghc
  • VictorCMiraldo/ghc
  • jamesbrock/ghc
  • andrewdmeier/ghc
  • luke/ghc
  • pranaysashank/ghc
  • cocreature/ghc
  • hithroc/ghc
  • obreitwi/ghc
  • slrtbtfs/ghc
  • kaol/ghc
  • yairchu/ghc
  • Mathemagician98/ghc
  • trac-taylorfausak/ghc
  • leungbk/ghc
  • MichaWiedenmann/ghc
  • chris-martin/ghc
  • TDecki/ghc
  • adithyaov/ghc
  • trac-gelisam/ghc
  • Lysxia/ghc
  • complyue/ghc
  • bwignall/ghc
  • sternmull/ghc
  • sonika/ghc
  • leif/ghc
  • broadwaylamb/ghc
  • myszon/ghc
  • danbroooks/ghc
  • Mechachleopteryx/ghc
  • zardyh/ghc
  • trac-vdukhovni/ghc
  • OmarKhaledAbdo/ghc
  • arrowd/ghc
  • Bodigrim/ghc
  • matheus23/ghc
  • cardenaso11/ghc
  • trac-Athas/ghc
  • mb720/ghc
  • DylanZA/ghc
  • liff/ghc
  • typedrat/ghc
  • trac-claude/ghc
  • jbm/ghc
  • Gertjan423/ghc
  • PHO/ghc
  • JKTKops/ghc
  • kockahonza/ghc
  • msakai/ghc
  • Sir4ur0n/ghc
  • barambani/ghc
  • vishnu.c/ghc
  • dcoutts/ghc
  • trac-runeks/ghc
  • trac-MaxGabriel/ghc
  • lexi.lambda/ghc
  • strake/ghc
  • spavikevik/ghc
  • JakobBruenker/ghc
  • rmanne/ghc
  • gdziadkiewicz/ghc
  • ani/ghc
  • iliastsi/ghc
  • smunix/ghc
  • judah/ghc
  • blackgnezdo/ghc
  • emilypi/ghc
  • trac-bpfoley/ghc
  • muesli4/ghc
  • trac-gkaracha/ghc
  • Kleidukos/ghc
  • nek0/ghc
  • TristanCacqueray/ghc
  • dwulive/ghc
  • mbakke/ghc
  • arybczak/ghc
  • Yang123321/ghc
  • maksbotan/ghc
  • QuietMisdreavus/ghc
  • trac-olshanskydr/ghc
  • emekoi/ghc
  • samuela/ghc
  • josephcsible/ghc
  • dramforever/ghc
  • lpsmith/ghc
  • DenisFrezzato/ghc
  • michivi/ghc
  • jneira/ghc
  • jeffhappily/ghc
  • Ivan-Yudin/ghc
  • nakaji-dayo/ghc
  • gdevanla/ghc
  • galen/ghc
  • fendor/ghc
  • yaitskov/ghc
  • rcythr/ghc
  • awpr/ghc
  • jeremyschlatter/ghc
  • Aver1y/ghc
  • mitchellvitez/ghc
  • merijn/ghc
  • tomjaguarpaw1/ghc
  • trac-NoidedSuper/ghc
  • erewok/ghc
  • trac-junji.hashimoto/ghc
  • adamwespiser/ghc
  • bjaress/ghc
  • jhrcek/ghc
  • leonschoorl/ghc
  • lukasz-golebiewski/ghc
  • sheaf/ghc
  • last-g/ghc
  • carassius1014/ghc
  • eschwartz/ghc
  • dwincort/ghc
  • felixwiemuth/ghc
  • TimWSpence/ghc
  • marcusmonteirodesouza/ghc
  • WJWH/ghc
  • vtols/ghc
  • theobat/ghc
  • BinderDavid/ghc
  • ckoparkar0/ghc
  • alexander-kjeldaas/ghc
  • dme2/ghc
  • philderbeast/ghc
  • aaronallen8455/ghc
  • rayshih/ghc
  • benkard/ghc
  • mpardalos/ghc
  • saidelman/ghc
  • leiftw/ghc
  • ca333/ghc
  • bwroga/ghc
  • nmichael44/ghc
  • trac-crobbins/ghc
  • felixonmars/ghc
  • adityagupta1089/ghc
  • hgsipiere/ghc
  • treeowl/ghc
  • alexpeits/ghc
  • CraigFe/ghc
  • dnlkrgr/ghc
  • kerckhove_ts/ghc
  • cptwunderlich/ghc
  • eiais/ghc
  • hahohihu/ghc
  • sanchayan/ghc
  • lemmih/ghc
  • sehqlr/ghc
  • trac-dbeacham/ghc
  • luite/ghc
  • trac-f-a/ghc
  • vados/ghc
  • luntain/ghc
  • fatho/ghc
  • alexbiehl-gc/ghc
  • dcbdan/ghc
  • tvh/ghc
  • liam-ly/ghc
  • timbobbarnes/ghc
  • GovanifY/ghc
  • shanth2600/ghc
  • gliboc/ghc
  • duog/ghc
  • moxonsghost/ghc
  • zander/ghc
  • masaeedu/ghc
  • georgefst/ghc
  • guibou/ghc
  • nicuveo/ghc
  • mdebruijne/ghc
  • stjordanis/ghc
  • emiflake/ghc
  • wygulmage/ghc
  • frasertweedale/ghc
  • coot/ghc
  • aratamizuki/ghc
  • tsandstr/ghc
  • mrBliss/ghc
  • Anton-Latukha/ghc
  • tadfisher/ghc
  • vapourismo/ghc
  • Sorokin-Anton/ghc
  • basile-henry/ghc
  • trac-mightybyte/ghc
  • AbsoluteNikola/ghc
  • cobrien99/ghc
  • songzh/ghc
  • blamario/ghc
  • aj4ayushjain/ghc
  • trac-utdemir/ghc
  • tangcl/ghc
  • hdgarrood/ghc
  • maerwald/ghc
  • arjun/ghc
  • ratherforky/ghc
  • haskieLambda/ghc
  • EmilGedda/ghc
  • Bogicevic/ghc
  • eddiejessup/ghc
  • kozross/ghc
  • AlistairB/ghc
  • 3Rafal/ghc
  • christiaanb/ghc
  • trac-bit/ghc
  • matsumonkie/ghc
  • trac-parsonsmatt/ghc
  • chisui/ghc
  • jaro/ghc
  • trac-kmiyazato/ghc
  • davidsd/ghc
  • Tritlo/ghc
  • I-B-3/ghc
  • lykahb/ghc
  • AriFordsham/ghc
  • turion1/ghc
  • berberman/ghc
  • christiantakle/ghc
  • zyklotomic/ghc
  • trac-ocramz/ghc
  • CSEdd/ghc
  • doyougnu/ghc
  • mmhat/ghc
  • why-not-try-calmer/ghc
  • plutotulp/ghc
  • kjekac/ghc
  • Manvi07/ghc
  • teo/ghc
  • cactus/ghc
  • CarrieMY/ghc
  • abel/ghc
  • yihming/ghc
  • tsakki/ghc
  • jessicah/ghc
  • oliverbunting/ghc
  • meld/ghc
  • friedbrice/ghc
  • Joald/ghc
  • abarbu/ghc
  • DigitalBrains1/ghc
  • sterni/ghc
  • alexDarcy/ghc
  • hexchain/ghc
  • minimario/ghc
  • zliu41/ghc
  • tommd/ghc
  • jazcarate/ghc
  • peterbecich/ghc
  • alirezaghey/ghc
  • solomon/ghc
  • mikael.urankar/ghc
  • davjam/ghc
  • int-index/ghc
  • MorrowM/ghc
  • nrnrnr/ghc
  • Sonfamm/ghc-test-only
  • afzt1/ghc
  • nguyenhaibinh-tpc/ghc
  • trac-lierdakil/ghc
  • MichaWiedenmann1/ghc
  • jmorag/ghc
  • Ziharrk/ghc
  • trac-MitchellSalad/ghc
  • juampe/ghc
  • jwaldmann/ghc
  • snowleopard/ghc
  • juhp/ghc
  • normalcoder/ghc
  • ksqsf/ghc
  • trac-jberryman/ghc
  • roberth/ghc
  • 1ntEgr8/ghc
  • epworth/ghc
  • MrAdityaAlok/ghc
  • JunmingZhao42/ghc
  • jappeace/ghc
  • trac-Gabriel439/ghc
  • alt-romes/ghc
  • HugoPeters1024/ghc
  • 10ne1/ghc-fork
  • agentultra/ghc
  • Garfield1002/ghc
  • ChickenProp/ghc
  • clyring/ghc
  • MaxHearnden/ghc
  • jumper149/ghc
  • vem/ghc
  • ketzacoatl/ghc
  • Rosuavio/ghc
  • jackohughes/ghc
  • p4l1ly/ghc
  • konsumlamm/ghc
  • shlevy/ghc
  • torsten.schmits/ghc
  • andremarianiello/ghc
  • amesgen/ghc
  • googleson78/ghc
  • InfiniteVerma/ghc
  • uhbif19/ghc
  • yiyunliu/ghc
  • raehik/ghc
  • mrkun/ghc
  • telser/ghc
  • 1Jajen1/ghc
  • slotThe/ghc
  • WinstonHartnett/ghc
  • mpilgrem/ghc
  • dreamsmasher/ghc
  • schuelermine/ghc
  • trac-Viwor/ghc
  • undergroundquizscene/ghc
  • evertedsphere/ghc
  • coltenwebb/ghc
  • oberblastmeister/ghc
  • agrue/ghc
  • lf-/ghc
  • zacwood9/ghc
  • steshaw/ghc
  • high-cloud/ghc
  • SkamDart/ghc
  • PiDelport/ghc
  • maoif/ghc
  • RossPaterson/ghc
  • CharlesTaylor7/ghc
  • ribosomerocker/ghc
  • trac-ramirez7/ghc
  • daig/ghc
  • NicolasT/ghc
  • FinleyMcIlwaine/ghc
  • lawtonnichols/ghc
  • jmtd/ghc
  • ozkutuk/ghc
  • wildsebastian/ghc
  • nikshalark/ghc
  • lrzlin/ghc
  • tobias/ghc
  • fw/ghc
  • hawkinsw/ghc
  • type-dance/ghc
  • rui314/ghc
  • ocharles/ghc
  • wavewave/ghc
  • TheKK/ghc
  • nomeata/ghc
  • trac-csabahruska/ghc
  • jonathanjameswatson/ghc
  • L-as/ghc
  • Axman6/ghc
  • barracuda156/ghc
  • trac-jship/ghc
  • jake-87/ghc
  • meooow/ghc
  • rebeccat/ghc
  • hamana55/ghc
  • Enigmage/ghc
  • kokobd/ghc
  • agevelt/ghc
  • gshen42/ghc
  • chrismwendt/ghc
  • MangoIV/ghc
  • teto/ghc
  • Sookr1/ghc
  • trac-thomasjm/ghc
  • barci2/ghc-dev
  • trac-m4dc4p/ghc
  • dixonary/ghc
  • breakerzirconia/ghc
  • alexsio27444/ghc
  • glocq/ghc
  • sourabhxyz/ghc
  • ryantrinkle/ghc
  • Jade/ghc
  • scedfaliako/ghc
  • martijnbastiaan/ghc
  • trac-george.colpitts/ghc
  • ammarbinfaisal/ghc
  • mimi.vx/ghc
  • lortabac/ghc
  • trac-zyla/ghc
  • benbellick/ghc
  • aadaa-fgtaa/ghc
  • jvanbruegge/ghc
  • archbung/ghc
  • gilmi/ghc
  • mfonism/ghc
  • alex-mckenna/ghc
  • Ei30metry/ghc
  • DiegoDiverio/ghc
  • jorgecunhamendes/ghc
  • liesnikov/ghc
  • akrmn/ghc
  • trac-simplifierticks/ghc
  • jacco/ghc
  • rhendric/ghc
  • damhiya/ghc
  • ryndubei/ghc
  • DaveBarton/ghc
  • trac-Profpatsch/ghc
  • GZGavinZhao/ghc
  • ncfavier/ghc
  • jameshaydon/ghc
  • ajccosta/ghc
  • dschrempf/ghc
  • cydparser/ghc
  • LinuxUserGD/ghc
  • elodielander/ghc
  • facundominguez/ghc
  • psilospore/ghc
  • lachrimae/ghc
  • dylan-thinnes/ghc-type-errors-plugin
  • hamishmack/ghc
  • Leary/ghc
  • lzszt/ghc
  • lyokha/ghc
  • trac-glaubitz/ghc
  • Rewbert/ghc
  • andreabedini/ghc
  • Jasagredo/ghc
  • sol/ghc
  • OlegAlexander/ghc
  • trac-sthibaul/ghc
  • avdv/ghc
  • Wendaolee/ghc
  • ur4t/ghc
  • daylily/ghc
  • boltzmannrain/ghc
  • mmzk1526/ghc
  • trac-fizzixnerd/ghc
  • soulomoon/ghc
  • rwmjones/ghc
  • j14i/ghc
  • tracsis/ghc
  • gesh/ghc
  • flip101/ghc
  • eldritch-cookie/ghc
  • LemonjamesD/ghc
  • pgujjula/ghc
  • skeuchel/ghc
  • noteed/ghc
  • gulin.serge/ghc
  • Torrekie/ghc
  • jlwoodwa/ghc
  • ayanamists/ghc
  • husong998/ghc
  • trac-edmundnoble/ghc
  • josephf/ghc
  • contrun/ghc
  • baulig/ghc
  • edsko/ghc
  • mzschr/ghc-issue-24732
  • ulidtko/ghc
  • Arsen/ghc
  • trac-sjoerd_visscher/ghc
  • crumbtoo/ghc
  • L0neGamer/ghc
  • DrewFenwick/ghc
  • benz0li/ghc
  • MaciejWas/ghc
  • jordanrule/ghc
  • trac-qqwy/ghc
  • LiamGoodacre/ghc
  • isomorpheme/ghc
  • trac-danidiaz/ghc
  • Kariim/ghc
  • MTaimoorZaeem/ghc
  • hololeap/ghc
  • ticat-fp/ghc
  • meritamen/ghc
  • criskell/ghc
  • trac-kraai/ghc
  • aergus/ghc
  • jdral/ghc
  • SamB/ghc
  • Tristian/ghc
  • ywgrit/ghc
  • KatsuPatrick/ghc
  • OsePedro/ghc
  • mpscholten/ghc
  • fp/ghc
  • zaquest/ghc
  • fangyi-zhou/ghc
  • augyg/ghc
640 results
Show changes
Commits on Source (22)
  • Ben Gamari's avatar
    gitlab-ci: Ensure that workaround for #18280 applies to bindisttest · d6279ff0
    Ben Gamari authored
    We need to ensure that the `configure` flags working around #18280 are
    propagated to the bindisttest `configure` as well.
    d6279ff0
  • Ben Gamari's avatar
    gitlab-ci: Allow ARMv7 job to fail · cb5c31b5
    Ben Gamari authored
    Due to #18298.
    cb5c31b5
  • John Ericson's avatar
    Clean up boot vs non-boot disambiguating types · 32a4ae90
    John Ericson authored and Marge Bot's avatar Marge Bot committed
    We often have (ModuleName, Bool) or (Module, Bool) pairs for "extended"
    module names (without or with a unit id) disambiguating boot and normal
    modules. We think this is important enough across the compiler that it
    deserves a new nominal product type. We do this with synnoyms and a
    functor named with a `Gen` prefix, matching other newly created
    definitions.
    
    It was also requested that we keep custom `IsBoot` / `NotBoot` sum type.
    So we have it too. This means changing many the many bools to use that
    instead.
    
    Updates `haddock` submodule.
    32a4ae90
  • Niklas Hambüchen's avatar
  • Andrew Martin's avatar
    Allow finalizeForeignPtr to be called on FinalPtr/PlainPtr. · 1b975aed
    Andrew Martin authored and Marge Bot's avatar Marge Bot committed
    MR 2165 (commit 49301ad6) regressed
    finalizeForeignPtr by throwing exceptions when PlainPtr was encounterd.
    This regression did not make it into a release of GHC. Here, the
    original behavior is restored, and FinalPtr is given the same treatment
    as PlainPtr.
    1b975aed
  • Luke Lau's avatar
    Fix documentation on type families not being extracted · 2bd3929a
    Luke Lau authored and Marge Bot's avatar Marge Bot committed
    It looks like the location of the Names used for CoAxioms on type
    families are now located at their type constructors. Previously, Docs.hs
    thought the Names were located in the RHS, so the RealSrcSpan in the
    instanceMap and getInstLoc didn't match up. Fixes #18241
    2bd3929a
  • Ben Gamari's avatar
    GHC.Hs.Instances: Compile with -O0 · 6735b9d9
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    This module contains exclusively Data instances, which are going to be
    slow no matter what we do. Furthermore, they are incredibly slow to
    compile with optimisation (see #9557). Consequently we compile this with
    -O0.  See #18254.
    6735b9d9
  • Alex D's avatar
    Add test for #17669 · c330331a
    Alex D authored and Marge Bot's avatar Marge Bot committed
    c330331a
  • Ben Gamari's avatar
    rts: Add Windows-specific implementation of rtsSleep · cab684f0
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously we would use the POSIX path, which uses `nanosleep`. However,
    it turns out that `nanosleep` is provided by `libpthread` on Windows. In
    general we don't want to incur such a dependency. Avoid this by simply
    using `Sleep` on Windows.
    
    Fixes #18272.
    cab684f0
  • Ben Gamari's avatar
    compiler: Disable use of process jobs with process < 1.6.9 · ad44b504
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Due to #17926.
    ad44b504
  • Moritz Angermann's avatar
    [linker] Adds void printLoadedObjects(void); · 6a4098a4
    Moritz Angermann authored
    This allows us to dump in-memory object code locations for debugging.
    
    Fixup printLoadedObjects prototype
    6a4098a4
  • Artem Pelenitsyn's avatar
    base: fix sign confusion in log1mexp implementation (fix #17125) · af5e3a88
    Artem Pelenitsyn authored and Marge Bot's avatar Marge Bot committed
    author: claude (https://gitlab.haskell.org/trac-claude)
    
    The correct threshold for log1mexp is -(log 2) with the current specification
    of log1mexp. This change improves accuracy for large negative inputs.
    
    To avoid code duplication, a small helper function is added;
    it isn't the default implementation in Floating because it needs Ord.
    
    This patch does nothing to address that the Haskell specification is
    different from that in common use in other languages.
    af5e3a88
  • Simon Peyton Jones's avatar
    Simple subsumption · 2b792fac
    Simon Peyton Jones authored
    This patch simplifies GHC to use simple subsumption.
      Ticket #17775
    
    Implements GHC proposal #287
       https://github.com/ghc-proposals/ghc-proposals/blob/master/
       proposals/0287-simplify-subsumption.rst
    
    All the motivation is described there; I will not repeat it here.
    The implementation payload:
     * tcSubType and friends become noticably simpler, because it no
       longer uses eta-expansion when checking subsumption.
     * No deeplyInstantiate or deeplySkolemise
    
    That in turn means that some tests fail, by design; they can all
    be fixed by eta expansion.  There is a list of such changes below.
    
    Implementing the patch led me into a variety of sticky corners, so
    the patch includes several othe changes, some quite significant:
    
    * I made String wired-in, so that
        "foo" :: String   rather than
        "foo" :: [Char]
      This improves error messages, and fixes #15679
    
    * The pattern match checker relies on knowing about in-scope equality
      constraints, andd adds them to the desugarer's environment using
      addTyCsDs.  But the co_fn in a FunBind was missed, and for some reason
      simple-subsumption ends up with dictionaries there. So I added a
      call to addTyCsDs.  This is really part of #18049.
    
    * I moved the ic_telescope field out of Implication and into
      ForAllSkol instead.  This is a nice win; just expresses the code
      much better.
    
    * There was a bug in GHC.Tc.TyCl.Instance.tcDataFamInstHeader.
      We called checkDataKindSig inside tc_kind_sig, /before/
      solveEqualities and zonking.  Obviously wrong, easily fixed.
    
    * solveLocalEqualitiesX: there was a whole mess in here, around
      failing fast enough.  I discovered a bad latent bug where we
      could successfully kind-check a type signature, and use it,
      but have unsolved constraints that could fill in coercion
      holes in that signature --  aargh.
    
      It's all explained in Note [Failure in local type signatures]
      in GHC.Tc.Solver. Much better now.
    
    * I fixed a serious bug in anonymous type holes. IN
        f :: Int -> (forall a. a -> _) -> Int
      that "_" should be a unification variable at the /outer/
      level; it cannot be instantiated to 'a'.  This was plain
      wrong.  New fields mode_lvl and mode_holes in TcTyMode,
      and auxiliary data type GHC.Tc.Gen.HsType.HoleMode.
    
      This fixes #16292, but makes no progress towards the more
      ambitious #16082
    
    * I got sucked into an enormous refactoring of the reporting of
      equality errors in GHC.Tc.Errors, especially in
          mkEqErr1
          mkTyVarEqErr
          misMatchMsg
          misMatchMsgOrCND
      In particular, the very tricky mkExpectedActualMsg function
      is gone.
    
      It took me a full day.  But the result is far easier to understand.
      (Still not easy!)  This led to various minor improvements in error
      output, and an enormous number of test-case error wibbles.
    
      One particular point: for occurs-check errors I now just say
         Can't match 'a' against '[a]'
      rather than using the intimidating language of "occurs check".
    
    * Pretty-printing AbsBinds
    
    Tests review
    
    * Eta expansions
       T11305: one eta expansion
       T12082: one eta expansion (undefined)
       T13585a: one eta expansion
       T3102:  one eta expansion
       T3692:  two eta expansions (tricky)
       T2239:  two eta expansions
       T16473: one eta
       determ004: two eta expansions (undefined)
       annfail06: two eta (undefined)
       T17923: four eta expansions (a strange program indeed!)
       tcrun035: one eta expansion
    
    * Ambiguity check at higher rank.  Now that we have simple
      subsumption, a type like
         f :: (forall a. Eq a => Int) -> Int
      is no longer ambiguous, because we could write
         g :: (forall a. Eq a => Int) -> Int
         g = f
      and it'd typecheck just fine.  But f's type is a bit
      suspicious, and we might want to consider making the
      ambiguity check do a check on each sub-term.  Meanwhile,
      these tests are accepted, whereas they were previously
      rejected as ambiguous:
         T7220a
         T15438
         T10503
         T9222
    
    * Some more interesting error message wibbles
       T13381: Fine: one error (Int ~ Exp Int)
               rather than two (Int ~ Exp Int, Exp Int ~ Int)
       T9834:  Small change in error (improvement)
       T10619: Improved
       T2414:  Small change, due to order of unification, fine
       T2534:  A very simple case in which a change of unification order
               means we get tow unsolved constraints instead of one
       tc211: bizarre impredicative tests; just accept this for now
    
    Updates Cabal and haddock submodules.
    
    Metric Increase:
      T12150
      T12234
      T5837
      haddock.base
    Metric Decrease:
      haddock.compiler
      haddock.Cabal
      haddock.base
    
    Merge note: This appears to break the
    `UnliftedNewtypesDifficultUnification` test. It has been marked as
    broken in the interest of merging.
    
    (cherry picked from commit 66b7b195)
    2b792fac
  • Ryan Scott's avatar
    Simplify bindLHsTyVarBndrs and bindHsQTyVars · 2dff8141
    Ryan Scott authored
    Both `bindLHsTyVarBndrs` and `bindHsQTyVars` take two separate
    `Maybe` arguments, which I find terribly confusing. Thankfully, it's
    possible to remove one `Maybe` argument from each of these functions,
    which this patch accomplishes:
    
    * `bindHsQTyVars` takes a `Maybe SDoc` argument, which is `Just` if
      GHC should warn about any of the quantified type variables going
      unused. However, every call site uses `Nothing` in practice. This
      makes sense, since it doesn't really make sense to warn about
      unused type variables bound by an `LHsQTyVars`. For instance, you
      wouldn't warn about the `a` in `data Proxy a = Proxy` going unused.
    
      As a result, I simply remove this `Maybe SDoc` argument altogether.
    * `bindLHsTyVarBndrs` also takes a `Maybe SDoc` argument for the same
      reasons that `bindHsQTyVars` took one. To make things more
      confusing, however, `bindLHsTyVarBndrs` also takes a separate
      `HsDocContext` argument, which is pretty-printed (to an `SDoc`) in
      warnings and error messages.
    
      In practice, the `Maybe SDoc` and the `HsDocContext` often contain
      the same text. See the call sites for `bindLHsTyVarBndrs` in
      `rnFamInstEqn` and `rnConDecl`, for instance. There are only a
      handful of call sites where the text differs between the
      `Maybe SDoc` and `HsDocContext` arguments:
    
      * In `rnHsRuleDecl`, where the `Maybe SDoc` says "`In the rule`"
        and the `HsDocContext` says "`In the transformation rule`".
      * In `rnHsTyKi`/`rn_ty`, where the `Maybe SDoc` says
        "`In the type`" but the `HsDocContext` is inhereted from the
        surrounding context (e.g., if `rnHsTyKi` were called on a
        top-level type signature, the `HsDocContext` would be
        "`In the type signature`" instead)
    
      In both cases, warnings/error messages arguably _improve_ by
      unifying making the `Maybe SDoc`'s text match that of the
      `HsDocContext`. As a result, I decided to remove the `Maybe SDoc`
      argument to `bindLHsTyVarBndrs` entirely and simply reuse the text
      from the `HsDocContext`. (I decided to change the phrase
      "transformation rule" to "rewrite rule" while I was in the area.)
    
      The `Maybe SDoc` argument has one other purpose: signaling when to
      emit "`Unused quantified type variable`" warnings. To recover this
      functionality, I replaced the `Maybe SDoc` argument with a
      boolean-like `WarnUnusedForalls` argument. The only
      `bindLHsTyVarBndrs` call site that chooses _not_ to emit these
      warnings in `bindHsQTyVars`.
    2dff8141
  • Ben Gamari's avatar
    hadrian: Add missing deriveConstants dependency on ghcplatform.h · e372331b
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    deriveConstants wants to compile C sources which #include PosixSource.h,
    which itself #includes ghcplatform.h. Make sure that Hadrian knows
    about this dependency.
    
    Fixes #18290.
    e372331b
  • Moritz Angermann's avatar
    ghc-prim needs to depend on libc and libm · b022051a
    Moritz Angermann authored and Marge Bot's avatar Marge Bot committed
    libm is just an empty shell on musl, and all the math functions are contained in
    libc.
    b022051a
  • Moritz Angermann's avatar
    Disable DLL loading if without system linker · 6dae6548
    Moritz Angermann authored and Marge Bot's avatar Marge Bot committed
    Some platforms (musl, aarch64) do not have a working dynamic linker
    implemented in the libc, even though we might see dlopen.  It will
    ultimately just return that this is not supported.  Hence we'll add
    a flag to the compiler to flat our disable loading dlls.  This is
    needed as we will otherwise try to load the shared library even
    if this will subsequently fail.  At that point we have given up
    looking for static options though.
    6dae6548
  • Moritz Angermann's avatar
    4a158ffc
  • Ben Gamari's avatar
    OccurAnal: Avoid exponential behavior due to where clauses · f1bfb806
    Ben Gamari authored
    Previously the `Var` case of `occAnalApp` could in some cases (namely
    in the case of `runRW#` applications) call `occAnalRhs` two. In the case
    of nested `runRW#`s this results in exponential complexity. In some
    cases the compilation time that resulted would be very long indeed
    (see #18296).
    
    Fixes #18296.
    
    Metric Decrease:
        T9961
        T12150
        T12234
    f1bfb806
  • Takenobu Tani's avatar
    Add link to GHC's wiki in the GHC API header · 9b607671
    Takenobu Tani authored and Marge Bot's avatar Marge Bot committed
    This adds a URL to point to GHC's wiki in the GHC API header.
    Newcomers could easily find more information from the GHC API's
    web like [1].
    
    [1]: Current version, https://ghc.gitlab.haskell.org/ghc/doc/libraries/ghc-8.11.0.20200604/index.html
    
    [skip ci]
    9b607671
  • Ryan Scott's avatar
    Make GADT constructors adhere to the forall-or-nothing rule properly · 72c7fe9a
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    Issue #18191 revealed that the types of GADT constructors don't quite
    adhere to the `forall`-or-nothing rule. This patch serves to clean up
    this sad state of affairs somewhat. The main change is not in the
    code itself, but in the documentation, as this patch introduces two
    sections to the GHC User's Guide:
    
    * A "Formal syntax for GADTs" section that presents a BNF-style
      grammar for what is and isn't allowed in GADT constructor types.
      This mostly exists to codify GHC's existing behavior, but it also
      imposes a new restriction that addresses #18191: the outermost
      `forall` and/or context in a GADT constructor is not allowed to be
      surrounded by parentheses. Doing so would make these
      `forall`s/contexts nested, and GADTs do not support nested
      `forall`s/contexts at present.
    
    * A "`forall`-or-nothing rule" section that describes exactly what
      the `forall`-or-nothing rule is all about. Surprisingly, there was
      no mention of this anywhere in the User's Guide up until now!
    
    To adhere the new specification in the "Formal syntax for GADTs"
    section of the User's Guide, the following code changes were made:
    
    * A new function, `GHC.Hs.Type.splitLHsGADTPrefixTy`, was introduced.
      This is very much like `splitLHsSigmaTy`, except that it avoids
      splitting apart any parentheses, which can be syntactically
      significant for GADT types. See
      `Note [No nested foralls or contexts in GADT constructors]` in
      `GHC.Hs.Type`.
    
    * `ConDeclGADTPrefixPs`, an extension constructor for `XConDecl`, was
      introduced so that `GHC.Parser.PostProcess.mkGadtDecl` can return
      it when given a prefix GADT constructor. Unlike `ConDeclGADT`,
      `ConDeclGADTPrefixPs` does not split the GADT type into its argument
      and result types, as this cannot be done until after the type is
      renamed (see `Note [GADT abstract syntax]` in `GHC.Hs.Decls` for why
      this is the case).
    
    * `GHC.Renamer.Module.rnConDecl` now has an additional case for
      `ConDeclGADTPrefixPs` that (1) splits apart the full `LHsType` into
      its `forall`s, context, argument types, and result type, and
      (2) checks for nested `forall`s/contexts. Step (2) used to be
      performed the typechecker (in `GHC.Tc.TyCl.badDataConTyCon`) rather
      than the renamer, but now the relevant code from the typechecker
      can simply be deleted.
    
      One nice side effect of this change is that we are able to give a
      more accurate error message for GADT constructors that use visible
      dependent quantification (e.g., `MkFoo :: forall a -> a -> Foo a`),
      which improves the stderr in the `T16326_Fail6` test case.
    
    Fixes #18191. Bumps the Haddock submodule.
    72c7fe9a
  • Tamar Christina's avatar
    winio: Add Atomic Exchange PrimOp and implement Atomic Ptr exchanges. · 6728d6b3
    Tamar Christina authored and Andreas Klebinger's avatar Andreas Klebinger committed
    
    The initial version was rewritten by Tamar Christina.
    It was rewritten in large parts by Andreas Klebinger.
    
    Co-authored-by: default avatarAndreas Klebinger <klebinger.andreas@gmx.at>
    6728d6b3
Showing
with 128 additions and 29 deletions
......@@ -479,12 +479,16 @@ nightly-aarch64-linux-deb9:
extends: .validate-linux
stage: full-build
image: "registry.gitlab.haskell.org/ghc/ci-images/armv7-linux-deb9:$DOCKER_REV"
# Due to linker issues
allow_failure: true
variables:
TEST_ENV: "armv7-linux-deb9"
BIN_DIST_PREP_TAR_COMP: "ghc-armv7-linux-deb9.tar.xz"
CONFIGURE_ARGS: "--host=armv7-linux-gnueabihf --build=armv7-linux-gnueabihf --target=armv7-linux-gnueabihf"
# N.B. We disable ld.lld explicitly here because it appears to fail
# non-deterministically on ARMv7. See #18280.
CONFIGURE_ARGS: "--host=armv7-linux-gnueabihf --build=armv7-linux-gnueabihf --target=armv7-linux-gnueabihf LD=ld.gold GccUseLdOpt=-fuse-ld=gold"
LD: "ld.gold"
GccUseLdOpt: "-fuse-ld=gold"
cache:
key: linux-armv7-deb9
tags:
......@@ -658,6 +662,7 @@ release-x86_64-linux-deb10:
extends: .validate-linux
stage: full-build
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV"
# Due to #18298.
allow_failure: true
variables:
TEST_ENV: "x86_64-linux-deb8"
......
......@@ -1341,8 +1341,9 @@ AC_DEFUN([FP_GCC_VERSION], [
AC_MSG_CHECKING([version of gcc])
fp_cv_gcc_version="`$CC -v 2>&1 | sed -n -e '1,/version /s/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/p'`"
AC_MSG_RESULT([$fp_cv_gcc_version])
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.6],
[AC_MSG_ERROR([Need at least gcc version 4.6 (4.7+ recommended)])])
# 4.7 is needed for __atomic_ builtins.
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.7],
[AC_MSG_ERROR([Need at least gcc version 4.7 (newer recommended)])])
])
AC_SUBST([GccVersion], [$fp_cv_gcc_version])
else
......
......@@ -936,7 +936,7 @@ getModSummary mod = do
mg <- liftM hsc_mod_graph getSession
let mods_by_name = [ ms | ms <- mgModSummaries mg
, ms_mod_name ms == mod
, not (isBootSummary ms) ]
, isBootSummary ms == NotBoot ]
case mods_by_name of
[] -> do dflags <- getDynFlags
liftIO $ throwIO $ mkApiErr dflags (text "Module not part of module graph")
......
......@@ -743,8 +743,7 @@ toInteger_RDR = nameRdrName toIntegerName
toRational_RDR = nameRdrName toRationalName
fromIntegral_RDR = nameRdrName fromIntegralName
stringTy_RDR, fromString_RDR :: RdrName
stringTy_RDR = tcQual_RDR gHC_BASE (fsLit "String")
fromString_RDR :: RdrName
fromString_RDR = nameRdrName fromStringName
fromList_RDR, fromListN_RDR, toList_RDR :: RdrName
......@@ -1680,11 +1679,13 @@ addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey,
mutableByteArrayPrimTyConKey, orderingTyConKey, mVarPrimTyConKey,
ratioTyConKey, rationalTyConKey, realWorldTyConKey, stablePtrPrimTyConKey,
stablePtrTyConKey, eqTyConKey, heqTyConKey,
smallArrayPrimTyConKey, smallMutableArrayPrimTyConKey :: Unique
smallArrayPrimTyConKey, smallMutableArrayPrimTyConKey,
stringTyConKey :: Unique
addrPrimTyConKey = mkPreludeTyConUnique 1
arrayPrimTyConKey = mkPreludeTyConUnique 3
boolTyConKey = mkPreludeTyConUnique 4
byteArrayPrimTyConKey = mkPreludeTyConUnique 5
stringTyConKey = mkPreludeTyConUnique 6
charPrimTyConKey = mkPreludeTyConUnique 7
charTyConKey = mkPreludeTyConUnique 8
doublePrimTyConKey = mkPreludeTyConUnique 9
......
......@@ -39,7 +39,7 @@ module GHC.Builtin.Types (
-- * Char
charTyCon, charDataCon, charTyCon_RDR,
charTy, stringTy, charTyConName,
charTy, stringTy, charTyConName, stringTyCon_RDR,
-- * Double
doubleTyCon, doubleDataCon, doubleTy, doubleTyConName,
......@@ -221,6 +221,7 @@ wiredInTyCons = [ -- Units are not treated like other tuples, because they
, anyTyCon
, boolTyCon
, charTyCon
, stringTyCon
, doubleTyCon
, floatTyCon
, intTyCon
......@@ -301,11 +302,12 @@ coercibleTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "Coercib
coercibleDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "MkCoercible") coercibleDataConKey coercibleDataCon
coercibleSCSelIdName = mkWiredInIdName gHC_TYPES (fsLit "coercible_sel") coercibleSCSelIdKey coercibleSCSelId
charTyConName, charDataConName, intTyConName, intDataConName :: Name
charTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "Char") charTyConKey charTyCon
charDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "C#") charDataConKey charDataCon
intTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "Int") intTyConKey intTyCon
intDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "I#") intDataConKey intDataCon
charTyConName, charDataConName, intTyConName, intDataConName, stringTyConName :: Name
charTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "Char") charTyConKey charTyCon
charDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "C#") charDataConKey charDataCon
stringTyConName = mkWiredInTyConName UserSyntax gHC_BASE (fsLit "String") stringTyConKey stringTyCon
intTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "Int") intTyConKey intTyCon
intDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "I#") intDataConKey intDataCon
boolTyConName, falseDataConName, trueDataConName :: Name
boolTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "Bool") boolTyConKey boolTyCon
......@@ -507,13 +509,14 @@ vecElemDataConNames = zipWith3Lazy mk_special_dc_name
mk_special_dc_name :: FastString -> Unique -> DataCon -> Name
mk_special_dc_name fs u dc = mkWiredInDataConName UserSyntax gHC_TYPES fs u dc
boolTyCon_RDR, false_RDR, true_RDR, intTyCon_RDR, charTyCon_RDR,
boolTyCon_RDR, false_RDR, true_RDR, intTyCon_RDR, charTyCon_RDR, stringTyCon_RDR,
intDataCon_RDR, listTyCon_RDR, consDataCon_RDR :: RdrName
boolTyCon_RDR = nameRdrName boolTyConName
false_RDR = nameRdrName falseDataConName
true_RDR = nameRdrName trueDataConName
intTyCon_RDR = nameRdrName intTyConName
charTyCon_RDR = nameRdrName charTyConName
stringTyCon_RDR = nameRdrName stringTyConName
intDataCon_RDR = nameRdrName intDataConName
listTyCon_RDR = nameRdrName listTyConName
consDataCon_RDR = nameRdrName consDataConName
......@@ -1402,7 +1405,15 @@ charDataCon :: DataCon
charDataCon = pcDataCon charDataConName [] [charPrimTy] charTyCon
stringTy :: Type
stringTy = mkListTy charTy -- convenience only
stringTy = mkTyConApp stringTyCon []
stringTyCon :: TyCon
-- We have this wired-in so that Haskell literal strings
-- get type String (in hsLitType), which in turn influences
-- inferred types and error messages
stringTyCon = buildSynTyCon stringTyConName
[] liftedTypeKind []
(mkListTy charTy)
intTy :: Type
intTy = mkTyConTy intTyCon
......
......@@ -2473,6 +2473,18 @@ primop WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
with has_side_effects = True
can_fail = True
primop InterlockedExchange_Addr "interlockedExchangeAddr#" GenPrimOp
Addr# -> Addr# -> State# s -> (# State# s, Addr# #)
{The atomic exchange operation. Atomically exchanges the value at the first address
with the Addr# given as second argument. Implies a read barrier.}
with has_side_effects = True
primop InterlockedExchange_Int "interlockedExchangeInt#" GenPrimOp
Addr# -> Int# -> State# s -> (# State# s, Int# #)
{The atomic exchange operation. Atomically exchanges the value at the address
with the given value. Returns the old value. Implies a read barrier.}
with has_side_effects = True
------------------------------------------------------------------------
section "Mutable variables"
{Operations on MutVar\#s.}
......
......@@ -632,6 +632,9 @@ data CallishMachOp
| MO_AtomicRead Width
| MO_AtomicWrite Width
| MO_Cmpxchg Width
-- Should be an AtomicRMW variant eventually.
-- Sequential consistent.
| MO_Xchg Width
deriving (Eq, Show)
-- | The operation to perform atomically.
......
......@@ -1022,7 +1022,12 @@ callishMachOps = listToUFM $
( "cmpxchg8", (MO_Cmpxchg W8,)),
( "cmpxchg16", (MO_Cmpxchg W16,)),
( "cmpxchg32", (MO_Cmpxchg W32,)),
( "cmpxchg64", (MO_Cmpxchg W64,))
( "cmpxchg64", (MO_Cmpxchg W64,)),
( "xchg8", (MO_Xchg W8,)),
( "xchg16", (MO_Xchg W16,)),
( "xchg32", (MO_Xchg W32,)),
( "xchg64", (MO_Xchg W64,))
-- ToDo: the rest, maybe
-- edit: which rest?
......
......@@ -4,6 +4,7 @@ module GHC.CmmToAsm.CPrim
, atomicWriteLabel
, atomicRMWLabel
, cmpxchgLabel
, xchgLabel
, popCntLabel
, pdepLabel
, pextLabel
......@@ -105,6 +106,15 @@ atomicRMWLabel w amop = "hs_atomic_" ++ pprFunName amop ++ pprWidth w
pprFunName AMO_Or = "or"
pprFunName AMO_Xor = "xor"
xchgLabel :: Width -> String
xchgLabel w = "hs_xchg" ++ pprWidth w
where
pprWidth W8 = "8"
pprWidth W16 = "16"
pprWidth W32 = "32"
pprWidth W64 = "64"
pprWidth w = pprPanic "xchgLabel: Unsupported word width " (ppr w)
cmpxchgLabel :: Width -> String
cmpxchgLabel w = "hs_cmpxchg" ++ pprWidth w
where
......
......@@ -2024,6 +2024,7 @@ genCCall' config gcp target dest_regs args
MO_Ctz _ -> unsupported
MO_AtomicRMW {} -> unsupported
MO_Cmpxchg w -> (fsLit $ cmpxchgLabel w, False)
MO_Xchg w -> (fsLit $ xchgLabel w, False)
MO_AtomicRead _ -> unsupported
MO_AtomicWrite _ -> unsupported
......
......@@ -677,6 +677,7 @@ outOfLineMachOp_table mop
MO_Ctz w -> fsLit $ ctzLabel w
MO_AtomicRMW w amop -> fsLit $ atomicRMWLabel w amop
MO_Cmpxchg w -> fsLit $ cmpxchgLabel w
MO_Xchg w -> fsLit $ xchgLabel w
MO_AtomicRead w -> fsLit $ atomicReadLabel w
MO_AtomicWrite w -> fsLit $ atomicWriteLabel w
......
......@@ -2518,6 +2518,22 @@ genCCall' _ is32Bit (PrimTarget (MO_Cmpxchg width)) [dst] [addr, old, new] _ = d
where
format = intFormat width
genCCall' config is32Bit (PrimTarget (MO_Xchg width)) [dst] [addr, value] _
| (is32Bit && width == W64) = panic "gencCall: 64bit atomic exchange not supported on 32bit platforms"
| otherwise = do
let dst_r = getRegisterReg platform (CmmLocal dst)
Amode amode addr_code <- getSimpleAmode is32Bit addr
(newval, newval_code) <- getSomeReg value
-- Copy the value into the target register, perform the exchange.
let code = toOL
[ MOV format (OpReg newval) (OpReg dst_r)
, XCHG format (OpAddr amode) dst_r
]
return $ addr_code `appOL` newval_code `appOL` code
where
format = intFormat width
platform = ncgPlatform config
genCCall' _ is32Bit target dest_regs args bid = do
platform <- ncgPlatform <$> getConfig
case (target, dest_regs) of
......@@ -3213,6 +3229,7 @@ outOfLineCmmOp bid mop res args
MO_AtomicRead _ -> fsLit "atomicread"
MO_AtomicWrite _ -> fsLit "atomicwrite"
MO_Cmpxchg _ -> fsLit "cmpxchg"
MO_Xchg _ -> should_be_inline
MO_UF_Conv _ -> unsupported
......@@ -3232,6 +3249,11 @@ outOfLineCmmOp bid mop res args
(MO_Prefetch_Data _ ) -> unsupported
unsupported = panic ("outOfLineCmmOp: " ++ show mop
++ " not supported here")
-- If we generate a call for the given primop
-- something went wrong.
should_be_inline = panic ("outOfLineCmmOp: " ++ show mop
++ " should be handled inline")
-- -----------------------------------------------------------------------------
-- Generating a table-branch
......
......@@ -329,6 +329,7 @@ data Instr
| LOCK Instr -- lock prefix
| XADD Format Operand Operand -- src (r), dst (r/m)
| CMPXCHG Format Operand Operand -- src (r), dst (r/m), eax implicit
| XCHG Format Operand Reg -- src (r/m), dst (r/m)
| MFENCE
data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2
......@@ -431,6 +432,7 @@ x86_regUsageOfInstr platform instr
LOCK i -> x86_regUsageOfInstr platform i
XADD _ src dst -> usageMM src dst
CMPXCHG _ src dst -> usageRMM src dst (OpReg eax)
XCHG _ src dst -> usageMM src (OpReg dst)
MFENCE -> noUsage
_other -> panic "regUsage: unrecognised instr"
......@@ -460,6 +462,7 @@ x86_regUsageOfInstr platform instr
usageMM :: Operand -> Operand -> RegUsage
usageMM (OpReg src) (OpReg dst) = mkRU [src, dst] [src, dst]
usageMM (OpReg src) (OpAddr ea) = mkRU (use_EA ea [src]) [src]
usageMM (OpAddr ea) (OpReg dst) = mkRU (use_EA ea [dst]) [dst]
usageMM _ _ = panic "X86.RegInfo.usageMM: no match"
-- 3 operand form; first operand Read; second Modified; third Modified
......@@ -589,6 +592,7 @@ x86_patchRegsOfInstr instr env
LOCK i -> LOCK (x86_patchRegsOfInstr i env)
XADD fmt src dst -> patch2 (XADD fmt) src dst
CMPXCHG fmt src dst -> patch2 (CMPXCHG fmt) src dst
XCHG fmt src dst -> XCHG fmt (patchOp src) (env dst)
MFENCE -> instr
_other -> panic "patchRegs: unrecognised instr"
......
......@@ -824,6 +824,9 @@ pprInstr platform i = case i of
SETCC cond op
-> pprCondInstr (sLit "set") cond (pprOperand platform II8 op)
XCHG format src val
-> pprFormatOpReg (sLit "xchg") format src val
JXX cond blockid
-> pprCondInstr (sLit "j") cond (ppr lab)
where lab = blockLbl blockid
......
......@@ -835,6 +835,7 @@ pprCallishMachOp_for_C mop
(MO_Ctz w) -> ptext (sLit $ ctzLabel w)
(MO_AtomicRMW w amop) -> ptext (sLit $ atomicRMWLabel w amop)
(MO_Cmpxchg w) -> ptext (sLit $ cmpxchgLabel w)
(MO_Xchg w) -> ptext (sLit $ xchgLabel w)
(MO_AtomicRead w) -> ptext (sLit $ atomicReadLabel w)
(MO_AtomicWrite w) -> ptext (sLit $ atomicWriteLabel w)
(MO_UF_Conv w) -> ptext (sLit $ word2FloatLabel w)
......
......@@ -281,6 +281,16 @@ genCall (PrimTarget (MO_Cmpxchg _width))
retVar' <- doExprW targetTy $ ExtractV retVar 0
statement $ Store retVar' dstVar
genCall (PrimTarget (MO_Xchg _width)) [dst] [addr, val] = runStmtsDecls $ do
dstV <- getCmmRegW (CmmLocal dst) :: WriterT LlvmAccum LlvmM LlvmVar
addrVar <- exprToVarW addr
valVar <- exprToVarW val
let ptrTy = pLift $ getVarType valVar
ptrExpr = Cast LM_Inttoptr addrVar ptrTy
ptrVar <- doExprW ptrTy ptrExpr
resVar <- doExprW (getVarType valVar) (AtomicRMW LAO_Xchg ptrVar valVar SyncSeqCst)
statement $ Store resVar dstV
genCall (PrimTarget (MO_AtomicWrite _width)) [] [addr, val] = runStmtsDecls $ do
addrVar <- exprToVarW addr
valVar <- exprToVarW val
......@@ -856,6 +866,7 @@ cmmPrimOpFunctions mop = do
MO_AtomicRMW _ _ -> unsupported
MO_AtomicWrite _ -> unsupported
MO_Cmpxchg _ -> unsupported
MO_Xchg _ -> unsupported
-- | Tail function calls
genJump :: CmmExpr -> [GlobalReg] -> LlvmM StmtData
......@@ -1943,10 +1954,10 @@ toIWord platform = mkIntLit (llvmWord platform)
-- | Error functions
panic :: String -> a
panic :: HasCallStack => String -> a
panic s = Outputable.panic $ "GHC.CmmToLlvm.CodeGen." ++ s
pprPanic :: String -> SDoc -> a
pprPanic :: HasCallStack => String -> SDoc -> a
pprPanic s d = Outputable.pprPanic ("GHC.CmmToLlvm.CodeGen." ++ s) d
......
......@@ -1291,7 +1291,7 @@ Orphan-hood is computed
{-
************************************************************************
* *
\subsection{Transformation rules}
\subsection{Rewrite rules}
* *
************************************************************************
......
......@@ -262,6 +262,7 @@ tidyCoAxBndrsForUser :: TidyEnv -> [Var] -> (TidyEnv, [Var])
-- forall a _1 _2. F _1 [a] _2 = ...
--
-- This is a rather disgusting function
-- See Note [Wildcard names] in GHC.Tc.Gen.HsType
tidyCoAxBndrsForUser init_env tcvs
= (tidy_env, reverse tidy_bndrs)
where
......
......@@ -467,7 +467,7 @@ lintCoreBindings dflags pass local_in_scope binds
where
all_pairs = flattenBinds binds
-- Put all the top-level binders in scope at the start
-- This is because transformation rules can bring something
-- This is because rewrite rules can bring something
-- into use 'unexpectedly'; see Note [Glomming] in OccurAnal
binders = map fst all_pairs
......
......@@ -1568,16 +1568,17 @@ occAnalRhs :: OccEnv -> Maybe JoinArity
-> CoreExpr -- RHS
-> (UsageDetails, CoreExpr)
occAnalRhs env mb_join_arity rhs
= (rhs_usage, rhs')
= case occAnalLamOrRhs env bndrs body of { (body_usage, bndrs', body') ->
let rhs' = mkLams (markJoinOneShots mb_join_arity bndrs') body'
-- For a /non-recursive/ join point we can mark all
-- its join-lambda as one-shot; and it's a good idea to do so
-- Final adjustment
rhs_usage = adjustRhsUsage mb_join_arity NonRecursive bndrs' body_usage
in (rhs_usage, rhs') }
where
(bndrs, body) = collectBinders rhs
(body_usage, bndrs', body') = occAnalLamOrRhs env bndrs body
rhs' = mkLams (markJoinOneShots mb_join_arity bndrs') body'
-- For a /non-recursive/ join point we can mark all
-- its join-lambda as one-shot; and it's a good idea to do so
-- Final adjustment
rhs_usage = adjustRhsUsage mb_join_arity NonRecursive bndrs' body_usage
occAnalUnfolding :: OccEnv
-> Maybe JoinArity -- See Note [Join points and unfoldings/rules]
......@@ -1885,12 +1886,18 @@ occAnalApp :: OccEnv
occAnalApp env (Var fun, args, ticks)
-- Account for join arity of runRW# continuation
-- See Note [Simplification of runRW#]
--
-- NB: Do not be tempted to make the next (Var fun, args, tick)
-- equation into an 'otherwise' clause for this equation
-- The former has a bang-pattern to occ-anal the args, and
-- we don't want to occ-anal them twice in the runRW# case!
-- This caused #18296
| fun `hasKey` runRWKey
, [t1, t2, arg] <- args
, let (usage, arg') = occAnalRhs env (Just 1) arg
= (usage, mkTicks ticks $ mkApps (Var fun) [t1, t2, arg'])
| otherwise
occAnalApp env (Var fun, args, ticks)
= (all_uds, mkTicks ticks $ mkApps fun' args')
where
(fun', fun_id') = lookupVarEnv (occ_bs_env env) fun
......