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 (37)
  • Ryan Scott's avatar
    Clean up "Eta reduction for data families" Notes · 9b39f2e6
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    Before, there were two distinct Notes named
    "Eta reduction for data families". This renames one of them to
    "Implementing eta reduction for data families" to disambiguate the
    two and fixes references in other parts of the codebase to ensure
    that they are pointing to the right place.
    
    Fixes #17313.
    
    [ci skip]
    9b39f2e6
  • Ryan Scott's avatar
    Fix the changelog/@since information for hGetContents'/getContents'/readFile' · 7627eab5
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    Fixes #17979.
    
    [ci skip]
    7627eab5
  • Sylvain Henry's avatar
    Kill wORDS_BIGENDIAN and replace it with platformByteOrder (#17957) · 0002db1b
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    Metric Decrease:
        T13035
        T1969
    0002db1b
  • Sebastian Graf's avatar
    PmCheck: Adjust recursion depth for inhabitation test · 7b217179
    Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
    In #17977, we ran into the reduction depth limit of the typechecker.
    That was only a symptom of a much broader issue: The recursion depth
    of the coverage checker for trying to instantiate strict fields in the
    `nonVoid` test was far too high (100, the `defaultMaxTcBound`).
    
    As a result, we were performing quite poorly on `T17977`.
    Short of a proper termination analysis to prove emptyness of a type,
    we just arbitrarily default to a much lower recursion limit of 3.
    
    Fixes #17977.
    7b217179
  • Andreas Klebinger's avatar
    Make hadrian pass on the no-colour setting to GHC. · 3c09f636
    Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
    Fixes #17983.
    3c09f636
  • Simon Peyton Jones's avatar
    Re-engineer the binder-swap transformation · b943b25d
    Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
    The binder-swap transformation is implemented by the occurrence
    analyser -- see Note [Binder swap] in OccurAnal. However it had
    a very nasty corner in it, for the case where the case scrutinee
    was a GlobalId.  This led to trouble and hacks, and ultimately
    to #16296.
    
    This patch re-engineers how the occurrence analyser implements
    the binder-swap, by actually carrying out a substitution rather
    than by adding a let-binding.  It's all described in
    Note [The binder-swap substitution].
    
    I did a few other things along the way
    
    * Fix a bug in StgCse, which could allow a loop breaker to be CSE'd
      away.  See Note [Care with loop breakers] in StgCse.  I think it can
      only show up if occurrence analyser sets up bad loop breakers, but
      still.
    
    * Better commenting in SimplUtils.prepareAlts
    
    * A little refactoring in CoreUnfold; nothing significant
      e.g. rename CoreUnfold.mkTopUnfolding to mkFinalUnfolding
    
    * Renamed CoreSyn.isFragileUnfolding to hasCoreUnfolding
    
    * Move mkRuleInfo to CoreFVs
    
    We observed respectively 4.6% and 5.9% allocation decreases for the following
    tests:
    
    Metric Decrease:
        T9961
        haddock.base
    b943b25d
  • Sebastian Graf's avatar
    Preserve precise exceptions in strictness analysis · 42d68364
    Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
    Fix #13380 and #17676 by
    
    1. Changing `raiseIO#` to have `topDiv` instead of `botDiv`
    2. Give it special treatment in `Simplifier.Util.mkArgInfo`, treating it
       as if it still had `botDiv`, to recover dead code elimination.
    
    This is the first commit of the plan outlined in
    !2525 (comment 260886).
    42d68364
  • Ömer Sinan Ağacan's avatar
    Fix a pointer format string in RTS · 0a88dd11
    Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
    0a88dd11
  • Ömer Sinan Ağacan's avatar
    Remove unused closure stg_IND_direct · 5beac042
    Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
    5beac042
  • Ben Gamari's avatar
    Session: Memoize stderrSupportsAnsiColors · 88f38b03
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Not only is this a reasonable efficiency measure but it avoids making
    reentrant calls into ncurses, which is not thread-safe. See #17922.
    88f38b03
  • Ryan Scott's avatar
    Make Hadrian build with Cabal-3.2 · 27740f24
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    GHC 8.10 ships with `Cabal-3.2.0.0`, so it would be convenient to
    make Hadrian supporting building against 3.2.* instead of having to
    rebuild the entirety of `Cabal-3.0.0.0`. There is one API change in
    `Cabal-3.2.*` that affects Hadrian: the `synopsis` and `description`
    functions now return `ShortText` instead of `String`. Since Hadrian
    manipulates these `String`s in various places, I found that the
    simplest fix was to use CPP to convert `ShortText` to `String`s
    where appropriate.
    27740f24
  • Sylvain Henry's avatar
    Update Stack resolver for hadrian/build-stack · 49802002
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    Broken by 57b888c0
    49802002
  • Ryan Scott's avatar
    Fix two ASSERT buglets in reifyDataCon · 30a63e79
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    Two `ASSERT`s in `reifyDataCon` were always using `arg_tys`, but
    `arg_tys` is not meaningful for GADT constructors. In fact, it's
    worse than non-meaningful, since using `arg_tys` when reifying a
    GADT constructor can lead to failed `ASSERT`ions, as #17305
    demonstrates.
    
    This patch applies the simplest possible fix to the immediate
    problem. The `ASSERT`s now use `r_arg_tys` instead of `arg_tys`, as
    the former makes sure to give something meaningful for GADT
    constructors. This makes the panic go away at the very least. There
    is still an underlying issue with the way the internals of
    `reifyDataCon` work, as described in
    #17305 (comment 227023), but we
    leave that as future work, since fixing the underlying issue is
    much trickier (see
    #17305 (comment 227087)).
    30a63e79
  • Zubin's avatar
    Add outputable instances for the types in GHC.Iface.Ext.Types, add -ddump-hie · ef7576c4
    Zubin authored and Marge Bot's avatar Marge Bot committed
    flag to dump pretty printed contents of the .hie file
    
    Metric Increase:
       hie002
    
    Because of the regression on i386:
    
    compile_time/bytes allocated increased from i386-linux-deb9 baseline @ HEAD~10:
        Expected    hie002 (normal) compile_time/bytes allocated: 583014888.0 +/-10%
        Lower bound hie002 (normal) compile_time/bytes allocated:   524713399
        Upper bound hie002 (normal) compile_time/bytes allocated:   641316377
        Actual      hie002 (normal) compile_time/bytes allocated:   877986292
        Deviation   hie002 (normal) compile_time/bytes allocated:        50.6 %
    *** unexpected stat test failure for hie002(normal)
    ef7576c4
  • Andreas Klebinger's avatar
    Improve and refactor StgToCmm codegen for DataCons. · 9462452a
    Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
    We now differentiate three cases of constructor bindings:
    
    1)Bindings which we can "replace" with a reference to
      an existing closure. Reference the replacement closure
      when accessing the binding.
    2)Bindings which we can "replace" as above. But we still
      generate a closure which will be referenced by modules
      importing this binding.
    3)For any other binding generate a closure. Then reference
      it.
    
    Before this patch 1) did only apply to local bindings and we
    didn't do 2) at all.
    9462452a
  • muesli4's avatar
    Add singleton to NonEmpty in libraries/base · a214d214
    muesli4 authored and Marge Bot's avatar Marge Bot committed
    This adds a definition to construct a singleton non-empty list
    (Data.List.NonEmpty) according to issue #17851.
    a214d214
  • Sylvain Henry's avatar
    Testsuite: measure compiler stats for T16190 · f7597aa0
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    We were mistakenly measuring program stats
    f7597aa0
  • Sylvain Henry's avatar
    Move blob handling into StgToCmm · a485c3c4
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    Move handling of big literal strings from CmmToAsm to StgToCmm. It
    avoids the use of `sdocWithDynFlags` (cf #10143). We might need to move
    this handling even higher in the pipeline in the future (cf #17960):
    this patch will make it easier.
    a485c3c4
  • Sylvain Henry's avatar
    Refactor CmmStatics · cc2918a0
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    In !2959 we noticed that there was some redundant code (in GHC.Cmm.Utils
    and GHC.Cmm.StgToCmm.Utils) used to deal with `CmmStatics` datatype
    (before SRT generation) and `RawCmmStatics` datatype (after SRT
    generation).
    
    This patch removes this redundant code by using a single GADT for
    (Raw)CmmStatics.
    cc2918a0
  • Maxim Koltsov's avatar
    Fix haddock formatting in Control.Monad.ST.Lazy.Imp.hs · 9e60273d
    Maxim Koltsov authored and Marge Bot's avatar Marge Bot committed
    9e60273d
  • Andreas Klebinger's avatar
    Turn newlines into spaces for hadrian/ghci. · 1b7e8a94
    Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
    The newlines break the command on windows.
    1b7e8a94
  • Simon Peyton Jones's avatar
    Major improvements to the specialiser · 4291bdda
    Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
    This patch is joint work of Alexis King and Simon PJ.  It does some
    significant refactoring of the type-class specialiser.  Main highlights:
    
    * We can specialise functions with types like
         f :: Eq a => a -> Ord b => b => blah
      where the classes aren't all at the front (#16473).  Here we can
      correctly specialise 'f' based on a call like
         f @Int @Bool dEqInt x dOrdBool
      This change really happened in an earlier patch
         commit 2d0cf625
         Author: Sandy Maguire <sandy@sandymaguire.me>
         Date:   Thu May 16 12:12:10 2019 -0400
      work that this new patch builds directly on that work, and refactors
      it a bit.
    
    * We can specialise functions with implicit parameters (#17930)
         g :: (?foo :: Bool, Show a) => a -> String
      Previously we could not, but now they behave just like a non-class
      argument as in 'f' above.
    
    * We can specialise under-saturated calls, where some (but not all of
      the dictionary arguments are provided (#17966).  For example, we can
      specialise the above 'f' based on a call
         map (f @Int dEqInt) xs
      even though we don't (and can't) give Ord dictionary.
    
      This may sound exotic, but #17966 is a program from the wild, and
      showed significant perf loss for functions like f, if you need
      saturation of all dictionaries.
    
    * We fix a buglet in which a floated dictionary had a bogus demand
      (#17810), by using zapIdDemandInfo in the NonRec case of specBind.
    
    * A tiny side benefit: we can drop dead arguments to specialised
      functions; see Note [Drop dead args from specialisations]
    
    * Fixed a bug in deciding what dictionaries are "interesting"; see
      Note [Keep the old dictionaries interesting]
    
    This is all achieved by by building on Sandy Macguire's work in
    defining SpecArg, which mkCallUDs uses to describe the arguments of
    the call. Main changes:
    
    * Main work is in specHeader, which marched down the [InBndr] from the
      function definition and the [SpecArg] from the call site, together.
    
    * specCalls no longer has an arity check; the entire mechanism now
      handles unders-saturated calls fine.
    
    * mkCallUDs decides on an argument-by-argument basis whether to
      specialise a particular dictionary argument; this is new.
      See mk_spec_arg in mkCallUDs.
    
    It looks as if there are many more lines of code, but I think that
    all the extra lines are comments!
    4291bdda
  • Ömer Sinan Ağacan's avatar
    Revert accidental change in 9462452a · 40a85563
    Ömer Sinan Ağacan authored
    [ci skip]
    40a85563
  • Ryan Scott's avatar
    Enable ImpredicativeTypes internally when typechecking selector bindings · bd75e5da
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    This is necessary for certain record selectors with higher-rank
    types, such as the examples in #18005. See
    `Note [Impredicative record selectors]` in `TcTyDecls`.
    
    Fixes #18005.
    bd75e5da
  • Ömer Sinan Ağacan's avatar
    Don't override proc CafInfos in ticky builds · dcfe29c8
    Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
    Fixes #17947
    
    When we have a ticky label for a proc, IdLabels for the ticky counter
    and proc entry share the same Name. This caused overriding proc CafInfos
    with the ticky CafInfos (i.e. NoCafRefs) during SRT analysis.
    
    We now ignore the ticky labels when building SRTMaps. This makes sense
    because:
    
    - When building the current module they don't need to be in SRTMaps as
      they're initialized as non-CAFFY (see mkRednCountsLabel), so they
      don't take part in the dependency analysis and they're never added to
      SRTs.
    
      (Reminder: a "dependency" in the SRT analysis is a CAFFY dependency,
      non-CAFFY uses are not considered as dependencies for the algorithm)
    
    - They don't appear in the interfaces as they're not exported, so it
      doesn't matter for cross-module concerns whether they're in the SRTMap
      or not.
    
    See also the new Note [Ticky labels in SRT analysis].
    dcfe29c8
  • Simon Peyton Jones's avatar
    Fix an tricky specialiser loop · cec2c71f
    Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
    Issue #17151 was a very tricky example of a bug in which the
    specialiser accidentally constructs a recurive dictionary,
    so that everything turns into bottom.
    
    I have fixed variants of this bug at least twice before:
    see Note [Avoiding loops].  It was a bit of a struggle
    to isolate the problem, greatly aided by the work that
    Alexey Kuleshevich did in distilling a test case.
    
    Once I'd understood the problem, it was not difficult to fix,
    though it did lead me a bit of refactoring in specImports.
    cec2c71f
  • Simon Peyton Jones's avatar
    Refactoring only · e850d14f
    Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
    This refactors DictBinds into a data type rather than a pair.
    No change in behaviour, just better code
    e850d14f
  • Daniel Gröber (dxld)'s avatar
    rts: ProfHeap: Fix memory leak when not compiled with profiling · f38e8d61
    Daniel Gröber (dxld) authored and Marge Bot's avatar Marge Bot committed
    If we're doing heap profiling on an unprofiled executable we keep
    allocating new space in initEra via nextEra on each profiler run but we
    don't have a corresponding freeEra call.
    
    We do free the last era in endHeapProfiling but previous eras will have
    been overwritten by initEra and will never get free()ed.
    
    Metric Decrease:
        space_leak_001
    f38e8d61
  • Sebastian Graf's avatar
    Re-export GHC.Magic.noinline from base · bcd66859
    Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
    bcd66859
  • Ben Gamari's avatar
    simplifier: Kill off ufKeenessFactor · 3d2991f8
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    We used to have another factor, ufKeenessFactor, which would scale the
    discounts before they were subtracted from the size. This was justified
    with the following comment:
    
      -- We multiple the raw discounts (args_discount and result_discount)
      -- ty opt_UnfoldingKeenessFactor because the former have to do with
      --  *size* whereas the discounts imply that there's some extra
      --  *efficiency* to be gained (e.g. beta reductions, case reductions)
      -- by inlining.
    
    However, this is highly suspect since it means that we subtract a
    *scaled* size from an absolute size, resulting in crazy (e.g. negative)
    scores in some cases (#15304). We consequently killed off
    ufKeenessFactor and bumped up the ufUseThreshold to compensate.
    
    Adjustment of unfolding use threshold
    =====================================
    
    Since this removes a discount from our inlining heuristic, I revisited our
    default choice of -funfolding-use-threshold to minimize the change in
    overall inlining behavior. Specifically, I measured runtime allocations
    and executable size of nofib and the testsuite performance tests built
    using compilers (and core libraries) built with several values of
    -funfolding-use-threshold.
    
    This comes as a result of a quantitative comparison of testsuite
    performance and code size as a function of ufUseThreshold, comparing
    GHC trees using values of 50, 60, 70, 80, 90, and 100. The test set
    consisted of nofib and the testsuite performance tests.
    A full summary of these measurements are found in the description of
    !2608
    
    Comparing executable sizes (relative to the base commit) across all
    nofib tests, we see that sizes are similar to the baseline:
    
                gmean      min      max   median
    thresh
    50         -6.36%   -7.04%   -4.82%   -6.46%
    60         -5.04%   -5.97%   -3.83%   -5.11%
    70         -2.90%   -3.84%   -2.31%   -2.92%
    80         -0.75%   -2.16%   -0.42%   -0.73%
    90         +0.24%   -0.41%   +0.55%   +0.26%
    100        +1.36%   +0.80%   +1.64%   +1.37%
    baseline   +0.00%   +0.00%   +0.00%   +0.00%
    
    Likewise, looking at runtime allocations we see that 80 gives slightly
    better optimisation than the baseline:
    
                gmean      min      max   median
    thresh
    50         +0.16%   -0.16%   +4.43%   +0.00%
    60         +0.09%   -0.00%   +3.10%   +0.00%
    70         +0.04%   -0.09%   +2.29%   +0.00%
    80         +0.02%   -1.17%   +2.29%   +0.00%
    90         -0.02%   -2.59%   +1.86%   +0.00%
    100        +0.00%   -2.59%   +7.51%   -0.00%
    baseline   +0.00%   +0.00%   +0.00%   +0.00%
    
    Finally, I had to add a NOINLINE in T4306 to ensure that `upd` is
    worker-wrappered as the test expects. This makes me wonder whether the
    inlining heuristic is now too liberal as `upd` is quite a large
    function. The same measure was taken in T12600.
    
                 Wall clock time compiling Cabal with -O0
    thresh       50     60     70     80     90      100    baseline
    build-Cabal  93.88  89.58  92.59  90.09  100.26  94.81  89.13
    
    Also, this change happens to avoid the spurious test output in
    `plugin-recomp-change` and `plugin-recomp-change-prof` (see #17308).
    
    Metric Decrease:
        hie002
        T12234
        T13035
        T13719
        T14683
        T4801
        T5631
        T5642
        T9020
        T9872d
        T9961
    Metric Increase:
        T12150
        T12425
        T13701
        T14697
        T15426
        T1969
        T3064
        T5837
        T6048
        T9203
        T9872a
        T9872b
        T9872c
        T9872d
        haddock.Cabal
        haddock.base
        haddock.compiler
    3d2991f8
  • Sylvain Henry's avatar
    Modules: type-checker (#13009) · 255418da
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    Update Haddock submodule
    255418da
  • Ryan Scott's avatar
    Make NoExtCon fields strict · 04b6cf94
    Ryan Scott authored
    This changes every unused TTG extension constructor to be strict in
    its field so that the pattern-match coverage checker is smart enough
    any such constructors are unreachable in pattern matches. This lets
    us remove nearly every use of `noExtCon` in the GHC API. The only
    ones we cannot remove are ones underneath uses of `ghcPass`, but that
    is only because GHC 8.8's and 8.10's coverage checkers weren't smart
    enough to perform this kind of reasoning. GHC HEAD's coverage
    checker, on the other hand, _is_ smart enough, so we guard these uses
    of `noExtCon` with CPP for now.
    
    Bumps the `haddock` submodule.
    
    Fixes #17992.
    04b6cf94
  • Ryan Scott's avatar
    Handle promoted data constructors in typeToLHsType correctly · 7802fa17
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    Instead of using `nlHsTyVar`, which hardcodes `NotPromoted`, have
    `typeToLHsType` pick between `Promoted` and `NotPromoted` by checking
    if a type constructor is promoted using `isPromotedDataCon`.
    
    Fixes #18020.
    7802fa17
  • Josh Meredith's avatar
    Implement extensible interface files · ec82dc49
    Josh Meredith authored
    ec82dc49
  • Josh Meredith's avatar
    9c0dba4e
  • Josh Meredith's avatar
    Add comment subtitle section for BinData · 32c87ef3
    Josh Meredith authored
    32c87ef3
  • Josh Meredith's avatar
Showing
with 167 additions and 132 deletions
......@@ -16,26 +16,26 @@
/includes/ @bgamari @simonmar @osa1
# The compiler
/compiler/parser/ @int-index
/compiler/hsSyn/ @simonpj @rae
/compiler/typecheck/ @simonpj @rae
/compiler/rename/ @simonpj @rae
/compiler/types/ @simonpj @rae
/compiler/deSugar/ @simonpj @rae
/compiler/typecheck/TcDeriv* @RyanGlScott
/compiler/nativeGen/ @simonmar @bgamari @AndreasK
/compiler/llvmGen/ @angerman
/compiler/codeGen/ @simonmar @osa1
/compiler/cmm/ @simonmar @osa1
/compiler/ghci/ @simonmar
/compiler/simplCore/CallArity.hs @nomeata
/compiler/utils/UnVarGraph.hs @nomeata
/compiler/simplCore/Exitify.hs @nomeata
/compiler/simplStg/StgCse.hs @nomeata
/compiler/simplStg/StgLiftLams.hs @sgraf
/compiler/cmm/CmmSwitch.hs @nomeata
/compiler/stranal/DmdAnal.hs @simonpj @sgraf
/compiler/hsSyn/Convert.hs @rae
/compiler/parser/ @int-index
/compiler/GHC/Hs/ @simonpj @rae
/compiler/GHC/Tc/ @simonpj @rae
/compiler/GHC/Rename/ @simonpj @rae
/compiler/GHC/Types/ @simonpj @rae
/compiler/GHC/HsToCore/ @simonpj @rae
/compiler/GHC/Tc/Deriv/ @RyanGlScott
/compiler/GHC/CmmToAsm/ @simonmar @bgamari @AndreasK
/compiler/GHC/CmmToLlvm/ @angerman
/compiler/GHC/StgToCmm/ @simonmar @osa1
/compiler/GHC/Cmm/ @simonmar @osa1
/compiler/ghci/ @simonmar
/compiler/GHC/Core/Op/CallArity.hs @nomeata
/compiler/utils/UnVarGraph.hs @nomeata
/compiler/GHC/Core/Op/Exitify.hs @nomeata
/compiler/GHC/Stg/CSE.hs @nomeata
/compiler/GHC/Stg/Lift.hs @sgraf
/compiler/GHC/Cmm/Switch.hs @nomeata
/compiler/GHC/Core/Op/DmdAnal.hs @simonpj @sgraf
/compiler/GHC/ThToHs.hs @rae
# Core libraries
/libraries/base/ @hvr
......
......@@ -308,16 +308,16 @@ import GHC.Driver.Make
import GHC.Driver.Hooks
import GHC.Driver.Pipeline ( compileOne' )
import GHC.Driver.Monad
import TcRnMonad ( finalSafeMode, fixSafeInstances, initIfaceTcRn )
import GHC.Iface.Load ( loadSysInterface )
import TcRnTypes
import GHC.Tc.Utils.Monad ( finalSafeMode, fixSafeInstances, initIfaceTcRn )
import GHC.Iface.Load ( loadSysInterface )
import GHC.Tc.Types
import GHC.Core.Predicate
import GHC.Driver.Packages
import GHC.Types.Name.Set
import GHC.Types.Name.Reader
import GHC.Hs
import GHC.Core.Type hiding( typeKind )
import TcType
import GHC.Tc.Utils.TcType
import GHC.Types.Id
import TysPrim ( alphaTyVars )
import GHC.Core.TyCon
......@@ -357,9 +357,9 @@ import Lexer
import ApiAnnotation
import qualified GHC.LanguageExtensions as LangExt
import GHC.Types.Name.Env
import TcRnDriver
import Inst
import FamInst
import GHC.Tc.Module
import GHC.Tc.Utils.Instantiate
import GHC.Tc.Instance.Family
import FileCleanup
import Data.Foldable
......@@ -1322,7 +1322,7 @@ getNameToInstancesIndex visible_mods mods_to_load = do
; (pkg_fie, home_fie) <- tcGetFamInstEnvs
-- We use Data.Sequence.Seq because we are creating left associated
-- mappends.
-- cls_index and fam_index below are adapted from TcRnDriver.lookupInsts
-- cls_index and fam_index below are adapted from GHC.Tc.Module.lookupInsts
; let cls_index = Map.fromListWith mappend
[ (n, Seq.singleton ispec)
| ispec <- instEnvElts ie_local ++ instEnvElts ie_global
......
-- Cmm representations using Hoopl's Graph CmmNode e x.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ExplicitNamespaces #-}
module GHC.Cmm (
-- * Cmm top-level datatypes
......@@ -7,7 +10,8 @@ module GHC.Cmm (
CmmDecl, CmmDeclSRTs, GenCmmDecl(..),
CmmGraph, GenCmmGraph(..),
CmmBlock, RawCmmDecl,
Section(..), SectionType(..), CmmStatics(..), RawCmmStatics(..), CmmStatic(..),
Section(..), SectionType(..),
GenCmmStatics(..), type CmmStatics, type RawCmmStatics, CmmStatic(..),
isSecConstant,
-- ** Blocks containing lists
......@@ -197,28 +201,31 @@ data Section = Section SectionType CLabel
data CmmStatic
= CmmStaticLit CmmLit
-- a literal value, size given by cmmLitRep of the literal.
-- ^ a literal value, size given by cmmLitRep of the literal.
| CmmUninitialised Int
-- uninitialised data, N bytes long
-- ^ uninitialised data, N bytes long
| CmmString ByteString
-- string of 8-bit values only, not zero terminated.
-- ^ string of 8-bit values only, not zero terminated.
| CmmFileEmbed FilePath
-- ^ an embedded binary file
-- Static data before SRT generation
data CmmStatics
= CmmStatics
CLabel -- Label of statics
CmmInfoTable
CostCentreStack
[CmmLit] -- Payload
| CmmStaticsRaw
CLabel -- Label of statics
[CmmStatic] -- The static data itself
-- Static data, after SRTs are generated
data RawCmmStatics
= RawCmmStatics
CLabel -- Label of statics
[CmmStatic] -- The static data itself
data GenCmmStatics (rawOnly :: Bool) where
CmmStatics
:: CLabel -- Label of statics
-> CmmInfoTable
-> CostCentreStack
-> [CmmLit] -- Payload
-> GenCmmStatics 'False
-- | Static data, after SRTs are generated
CmmStaticsRaw
:: CLabel -- Label of statics
-> [CmmStatic] -- The static data itself
-> GenCmmStatics a
type CmmStatics = GenCmmStatics 'False
type RawCmmStatics = GenCmmStatics 'True
-- -----------------------------------------------------------------------------
-- Basic blocks consisting of lists
......
......@@ -108,7 +108,7 @@ module GHC.Cmm.CLabel (
pprCLabel,
isInfoTableLabel,
isConInfoTableLabel,
isIdLabel
isIdLabel, isTickyLabel
) where
#include "HsVersions.h"
......@@ -268,6 +268,12 @@ isIdLabel :: CLabel -> Bool
isIdLabel IdLabel{} = True
isIdLabel _ = False
-- Used in SRT analysis. See Note [Ticky labels in SRT analysis] in
-- GHC.Cmm.Info.Build.
isTickyLabel :: CLabel -> Bool
isTickyLabel (IdLabel _ _ RednCounts) = True
isTickyLabel _ = False
-- This is laborious, but necessary. We can't derive Ord because
-- Unique doesn't have an Ord instance. Note nonDetCmpUnique in the
-- implementation. See Note [No Ord for Unique]
......@@ -462,8 +468,7 @@ mkSRTLabel :: Unique -> CLabel
mkSRTLabel u = SRTLabel u
mkRednCountsLabel :: Name -> CLabel
mkRednCountsLabel name =
IdLabel name NoCafRefs RednCounts -- Note [ticky for LNE]
mkRednCountsLabel name = IdLabel name NoCafRefs RednCounts -- Note [ticky for LNE]
-- These have local & (possibly) external variants:
mkLocalClosureLabel :: Name -> CafInfo -> CLabel
......
......@@ -162,7 +162,7 @@ cmmDebugGen modLoc decls = map (blocksForScope Nothing) topScopes
= DebugBlock { dblProcedure = g_entry graph
, dblLabel = label
, dblCLabel = case info of
Just (RawCmmStatics infoLbl _) -> infoLbl
Just (CmmStaticsRaw infoLbl _) -> infoLbl
Nothing
| g_entry graph == label -> entryLbl
| otherwise -> blockLbl label
......
......@@ -368,7 +368,7 @@ instance Ord r => DefinerOfRegs r r where
instance (Ord r, UserOfRegs r CmmReg) => UserOfRegs r CmmExpr where
-- The (Ord r) in the context is necessary here
-- See Note [Recursive superclasses] in TcInstDcls
-- See Note [Recursive superclasses] in GHC.Tc.TyCl.Instance
foldRegsUsed dflags f !z e = expr z e
where expr z (CmmLit _) = z
expr z (CmmLoad addr _) = foldRegsUsed dflags f z addr
......
......@@ -167,7 +167,7 @@ mkInfoTable dflags proc@(CmmProc infos entry_lbl live blocks)
rel_std_info = map (makeRelativeRefTo dflags info_lbl) std_info
rel_extra_bits = map (makeRelativeRefTo dflags info_lbl) extra_bits
--
return (top_decls, (lbl, RawCmmStatics info_lbl $ map CmmStaticLit $
return (top_decls, (lbl, CmmStaticsRaw info_lbl $ map CmmStaticLit $
reverse rel_extra_bits ++ rel_std_info))
-----------------------------------------------------
......@@ -206,7 +206,7 @@ mkInfoTableContents dflags
; return (prof_data ++ liveness_data, (std_info, srt_label)) }
| HeapRep _ ptrs nonptrs closure_type <- smrep
= do { let layout = packIntsCLit dflags ptrs nonptrs
= do { let layout = packIntsCLit platform ptrs nonptrs
; (prof_lits, prof_data) <- mkProfLits platform prof
; let (srt_label, srt_bitmap) = mkSRTLit dflags info_lbl srt
; (mb_srt_field, mb_layout, extra_bits, ct_data)
......@@ -238,14 +238,14 @@ mkInfoTableContents dflags
-- Layout known (one free var); we use the layout field for offset
mk_pieces (Fun arity (ArgSpec fun_type)) srt_label
= do { let extra_bits = packIntsCLit dflags fun_type arity : srt_label
= do { let extra_bits = packIntsCLit platform fun_type arity : srt_label
; return (Nothing, Nothing, extra_bits, []) }
mk_pieces (Fun arity (ArgGen arg_bits)) srt_label
= do { (liveness_lit, liveness_data) <- mkLivenessBits dflags arg_bits
; let fun_type | null liveness_data = aRG_GEN
| otherwise = aRG_GEN_BIG
extra_bits = [ packIntsCLit dflags fun_type arity ]
extra_bits = [ packIntsCLit platform fun_type arity ]
++ (if inlineSRT dflags then [] else [ srt_lit ])
++ [ liveness_lit, slow_entry ]
; return (Nothing, Nothing, extra_bits, liveness_data) }
......@@ -259,11 +259,10 @@ mkInfoTableContents dflags
mkInfoTableContents _ _ _ = panic "mkInfoTableContents" -- NonInfoTable dealt with earlier
packIntsCLit :: DynFlags -> Int -> Int -> CmmLit
packIntsCLit dflags a b = packHalfWordsCLit dflags
packIntsCLit :: Platform -> Int -> Int -> CmmLit
packIntsCLit platform a b = packHalfWordsCLit platform
(toStgHalfWord platform (fromIntegral a))
(toStgHalfWord platform (fromIntegral b))
where platform = targetPlatform dflags
mkSRTLit :: DynFlags
......
......@@ -409,6 +409,30 @@ Maybe, but could you prove that RET_FUN is the only way that
resurrection can occur?
So, no shortcutting.
Note [Ticky labels in SRT analysis]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Raw Cmm data (CmmStaticsRaw) can't contain pointers so they're considered
non-CAFFY in SRT analysis and we update the SRTMap mapping them to `Nothing`
(meaning they're not CAFFY).
However when building with -ticky we generate ticky CLabels using the function's
`Name`. For example, if we have a top-level function `sat_s1rQ`, in a ticky
build we get two IdLabels using the name `sat_s1rQ`:
- For the function itself: IdLabel sat_s1rQ ... Entry
- For the ticky counter: IdLabel sat_s1rQ ... RednCounts
In these cases we really want to use the function definition for the SRT
analysis of this Name, because that's what we export for this Name -- ticky
counters are not exported. So we ignore ticky counters in SRT analysis (which
are never CAFFY and never exported).
Not doing this caused #17947 where we analysed the function first mapped the
name to CAFFY. We then saw the ticky constructor, and becuase it has the same
Name as the function and is not CAFFY we overrode the CafInfo of the name as
non-CAFFY.
-}
-- ---------------------------------------------------------------------
......@@ -818,8 +842,11 @@ doSRTs dflags moduleSRTInfo procs data_ = do
-- already updated by oneSRT
srtMap
CmmData _ (CmmStaticsRaw lbl _)
| isIdLabel lbl ->
-- not analysed by oneSRT, declare it non-CAFFY here
| isIdLabel lbl && not (isTickyLabel lbl) ->
-- Raw data are not analysed by oneSRT and they can't
-- be CAFFY.
-- See Note [Ticky labels in SRT analysis] above for
-- why we exclude ticky labels here.
Map.insert (mkCAFLabel lbl) Nothing srtMap
| otherwise ->
-- Not an IdLabel, ignore
......@@ -1107,10 +1134,10 @@ updInfoSRTs
-> [CmmDeclSRTs]
updInfoSRTs _ _ _ _ (CmmData s (CmmStaticsRaw lbl statics))
= [CmmData s (RawCmmStatics lbl statics)]
= [CmmData s (CmmStaticsRaw lbl statics)]
updInfoSRTs dflags _ _ caffy (CmmData s (CmmStatics lbl itbl ccs payload))
= [CmmData s (RawCmmStatics lbl (map CmmStaticLit field_lits))]
= [CmmData s (CmmStaticsRaw lbl (map CmmStaticLit field_lits))]
where
caf_info = if caffy then MayHaveCafRefs else NoCafRefs
field_lits = mkStaticClosureFields dflags itbl ccs caf_info payload
......
......@@ -348,7 +348,7 @@ instance UserOfRegs GlobalReg (CmmNode e x) where
instance (Ord r, UserOfRegs r CmmReg) => UserOfRegs r ForeignTarget where
-- The (Ord r) in the context is necessary here
-- See Note [Recursive superclasses] in TcInstDcls
-- See Note [Recursive superclasses] in GHC.Tc.TyCl.Instance
foldRegsUsed _ _ !z (PrimTarget _) = z
foldRegsUsed dflags f !z (ForeignTarget e _) = foldRegsUsed dflags f z e
......
......@@ -1167,7 +1167,7 @@ staticClosure :: UnitId -> FastString -> FastString -> [CmmLit] -> CmmParse ()
staticClosure pkg cl_label info payload
= do dflags <- getDynFlags
let lits = mkStaticClosure dflags (mkCmmInfoLabel pkg info) dontCareCCS payload [] [] []
code $ emitRawDataLits (mkCmmDataLabel pkg cl_label) lits
code $ emitDataLits (mkCmmDataLabel pkg cl_label) lits
foreignCall
:: String
......
{-# LANGUAGE GADTs #-}
----------------------------------------------------------------------------
--
-- Pretty-printing of common Cmm types
......@@ -70,12 +72,9 @@ instance (Outputable d, Outputable info, Outputable i)
=> Outputable (GenCmmDecl d info i) where
ppr t = pprTop t
instance Outputable CmmStatics where
instance Outputable (GenCmmStatics a) where
ppr = pprStatics
instance Outputable RawCmmStatics where
ppr = pprRawStatics
instance Outputable CmmStatic where
ppr e = sdocWithDynFlags $ \dflags ->
pprStatic (targetPlatform dflags) e
......@@ -142,19 +141,17 @@ instance Outputable ForeignHint where
-- following C--
--
pprStatics :: CmmStatics -> SDoc
pprStatics :: GenCmmStatics a -> SDoc
pprStatics (CmmStatics lbl itbl ccs payload) =
ppr lbl <> colon <+> ppr itbl <+> ppr ccs <+> ppr payload
pprStatics (CmmStaticsRaw lbl ds) = pprRawStatics (RawCmmStatics lbl ds)
pprRawStatics :: RawCmmStatics -> SDoc
pprRawStatics (RawCmmStatics lbl ds) = vcat ((ppr lbl <> colon) : map ppr ds)
pprStatics (CmmStaticsRaw lbl ds) = vcat ((ppr lbl <> colon) : map ppr ds)
pprStatic :: Platform -> CmmStatic -> SDoc
pprStatic platform s = case s of
CmmStaticLit lit -> nest 4 $ text "const" <+> pprLit platform lit <> semi
CmmUninitialised i -> nest 4 $ text "I8" <> brackets (int i)
CmmString s' -> nest 4 $ text "I8[]" <+> text (show s')
CmmFileEmbed path -> nest 4 $ text "incbin " <+> text (show path)
-- --------------------------------------------------------------------------
-- data sections
......
......@@ -20,7 +20,7 @@ module GHC.Cmm.Utils(
-- CmmLit
zeroCLit, mkIntCLit,
mkWordCLit, packHalfWordsCLit,
mkByteStringCLit,
mkByteStringCLit, mkFileEmbedLit,
mkDataLits, mkRODataLits,
mkStgWordCLit,
......@@ -195,23 +195,29 @@ zeroExpr platform = CmmLit (zeroCLit platform)
mkWordCLit :: Platform -> Integer -> CmmLit
mkWordCLit platform wd = CmmInt wd (wordWidth platform)
-- | We make a top-level decl for the string, and return a label pointing to it
mkByteStringCLit
:: CLabel -> ByteString -> (CmmLit, GenCmmDecl RawCmmStatics info stmt)
-- We have to make a top-level decl for the string,
-- and return a literal pointing to it
:: CLabel -> ByteString -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
mkByteStringCLit lbl bytes
= (CmmLabel lbl, CmmData (Section sec lbl) $ RawCmmStatics lbl [CmmString bytes])
= (CmmLabel lbl, CmmData (Section sec lbl) $ CmmStaticsRaw lbl [CmmString bytes])
where
-- This can not happen for String literals (as there \NUL is replaced by
-- C0 80). However, it can happen with Addr# literals.
sec = if 0 `BS.elem` bytes then ReadOnlyData else CString
mkDataLits :: Section -> CLabel -> [CmmLit] -> GenCmmDecl RawCmmStatics info stmt
-- Build a data-segment data block
-- | We make a top-level decl for the embedded binary file, and return a label pointing to it
mkFileEmbedLit
:: CLabel -> FilePath -> (CmmLit, GenCmmDecl (GenCmmStatics raw) info stmt)
mkFileEmbedLit lbl path
= (CmmLabel lbl, CmmData (Section ReadOnlyData lbl) (CmmStaticsRaw lbl [CmmFileEmbed path]))
-- | Build a data-segment data block
mkDataLits :: Section -> CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
mkDataLits section lbl lits
= CmmData section (RawCmmStatics lbl $ map CmmStaticLit lits)
= CmmData section (CmmStaticsRaw lbl $ map CmmStaticLit lits)
mkRODataLits :: CLabel -> [CmmLit] -> GenCmmDecl RawCmmStatics info stmt
mkRODataLits :: CLabel -> [CmmLit] -> GenCmmDecl (GenCmmStatics raw) info stmt
-- Build a read-only data block
mkRODataLits lbl lits
= mkDataLits section lbl lits
......@@ -225,19 +231,18 @@ mkRODataLits lbl lits
mkStgWordCLit :: Platform -> StgWord -> CmmLit
mkStgWordCLit platform wd = CmmInt (fromStgWord wd) (wordWidth platform)
packHalfWordsCLit :: DynFlags -> StgHalfWord -> StgHalfWord -> CmmLit
packHalfWordsCLit :: Platform -> StgHalfWord -> StgHalfWord -> CmmLit
-- Make a single word literal in which the lower_half_word is
-- at the lower address, and the upper_half_word is at the
-- higher address
-- ToDo: consider using half-word lits instead
-- but be careful: that's vulnerable when reversed
packHalfWordsCLit dflags lower_half_word upper_half_word
= if wORDS_BIGENDIAN dflags
then mkWordCLit platform ((l `shiftL` halfWordSizeInBits platform) .|. u)
else mkWordCLit platform (l .|. (u `shiftL` halfWordSizeInBits platform))
packHalfWordsCLit platform lower_half_word upper_half_word
= case platformByteOrder platform of
BigEndian -> mkWordCLit platform ((l `shiftL` halfWordSizeInBits platform) .|. u)
LittleEndian -> mkWordCLit platform (l .|. (u `shiftL` halfWordSizeInBits platform))
where l = fromStgHalfWord lower_half_word
u = fromStgHalfWord upper_half_word
platform = targetPlatform dflags
---------------------------------------------------
--
......
......@@ -669,7 +669,7 @@ getRegister' dflags _ (CmmLit (CmmFloat f frep)) = do
let format = floatFormat frep
code dst =
LDATA (Section ReadOnlyData lbl)
(RawCmmStatics lbl [CmmStaticLit (CmmFloat f frep)])
(CmmStaticsRaw lbl [CmmStaticLit (CmmFloat f frep)])
`consOL` (addr_code `snocOL` LD format dst addr)
return (Any format code)
......@@ -689,7 +689,7 @@ getRegister' dflags platform (CmmLit lit)
let rep = cmmLitType platform lit
format = cmmTypeFormat rep
code dst =
LDATA (Section ReadOnlyData lbl) (RawCmmStatics lbl [CmmStaticLit lit])
LDATA (Section ReadOnlyData lbl) (CmmStaticsRaw lbl [CmmStaticLit lit])
`consOL` (addr_code `snocOL` LD format dst addr)
return (Any format code)
......@@ -2110,7 +2110,7 @@ generateJumpTableForInstr config (BCTR ids (Just lbl) _) =
= CmmStaticLit (CmmLabelDiffOff blockLabel lbl 0
(ncgWordWidth config))
where blockLabel = blockLbl blockid
in Just (CmmData (Section ReadOnlyData lbl) (RawCmmStatics lbl jumpTable))
in Just (CmmData (Section ReadOnlyData lbl) (CmmStaticsRaw lbl jumpTable))
generateJumpTableForInstr _ _ = Nothing
-- -----------------------------------------------------------------------------
......@@ -2340,7 +2340,7 @@ coerceInt2FP' ArchPPC fromRep toRep x = do
Amode addr addr_code <- getAmode D dynRef
let
code' dst = code `appOL` maybe_exts `appOL` toOL [
LDATA (Section ReadOnlyData lbl) $ RawCmmStatics lbl
LDATA (Section ReadOnlyData lbl) $ CmmStaticsRaw lbl
[CmmStaticLit (CmmInt 0x43300000 W32),
CmmStaticLit (CmmInt 0x80000000 W32)],
XORIS itmp src (ImmInt 0x8000),
......
......@@ -61,7 +61,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
-- so label needed
vcat (map (pprBasicBlock platform top_info) blocks)
Just (RawCmmStatics info_lbl _) ->
Just (CmmStaticsRaw info_lbl _) ->
pprSectionAlign config (Section Text info_lbl) $$
(if platformHasSubsectionsViaSymbols platform
then ppr (mkDeadStripPreventer info_lbl) <> char ':'
......@@ -113,7 +113,7 @@ pprBasicBlock platform info_env (BasicBlock blockid instrs)
where
maybe_infotable = case mapLookup blockid info_env of
Nothing -> empty
Just (RawCmmStatics info_lbl info) ->
Just (CmmStaticsRaw info_lbl info) ->
pprAlignForSection platform Text $$
vcat (map (pprData platform) info) $$
pprLabel platform info_lbl
......@@ -122,7 +122,7 @@ pprBasicBlock platform info_env (BasicBlock blockid instrs)
pprDatas :: Platform -> RawCmmStatics -> SDoc
-- See note [emit-time elimination of static indirections] in CLabel.
pprDatas _platform (RawCmmStatics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
pprDatas _platform (CmmStaticsRaw alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
labelInd (CmmLabel l) = Just l
......@@ -131,11 +131,12 @@ pprDatas _platform (RawCmmStatics alias [CmmStaticLit (CmmLabel lbl), CmmStaticL
, alias `mayRedirectTo` ind'
= pprGloblDecl alias
$$ text ".equiv" <+> ppr alias <> comma <> ppr (CmmLabel ind')
pprDatas platform (RawCmmStatics lbl dats) = vcat (pprLabel platform lbl : map (pprData platform) dats)
pprDatas platform (CmmStaticsRaw lbl dats) = vcat (pprLabel platform lbl : map (pprData platform) dats)
pprData :: Platform -> CmmStatic -> SDoc
pprData platform d = case d of
CmmString str -> pprBytes str
CmmString str -> pprString str
CmmFileEmbed path -> pprFileEmbed path
CmmUninitialised bytes -> text ".space " <> int bytes
CmmStaticLit lit -> pprDataItem platform lit
......
......@@ -48,8 +48,8 @@ shortcutJump _ other = other
-- Here because it knows about JumpDest
shortcutStatics :: (BlockId -> Maybe JumpDest) -> RawCmmStatics -> RawCmmStatics
shortcutStatics fn (RawCmmStatics lbl statics)
= RawCmmStatics lbl $ map (shortcutStatic fn) statics
shortcutStatics fn (CmmStaticsRaw lbl statics)
= CmmStaticsRaw lbl $ map (shortcutStatic fn) statics
-- we need to get the jump tables, so apply the mapping to the entries
-- of a CmmData too.
......
......@@ -14,7 +14,8 @@ module GHC.CmmToAsm.Ppr (
floatToBytes,
doubleToBytes,
pprASCII,
pprBytes,
pprString,
pprFileEmbed,
pprSectionHeader
)
......@@ -26,11 +27,9 @@ import AsmUtils
import GHC.Cmm.CLabel
import GHC.Cmm
import GHC.CmmToAsm.Config
import GHC.Driver.Session
import FastString
import Outputable
import GHC.Platform
import FileCleanup
import qualified Data.Array.Unsafe as U ( castSTUArray )
import Data.Array.ST
......@@ -43,7 +42,6 @@ import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import GHC.Exts
import GHC.Word
import System.IO.Unsafe
......@@ -129,24 +127,18 @@ pprASCII str
]
ord0 = 0x30 -- = ord '0'
-- | Pretty print binary data.
--
-- Use either the ".string" directive or a ".incbin" directive.
-- See Note [Embedding large binary blobs]
-- | Emit a ".string" directive
pprString :: ByteString -> SDoc
pprString bs = text "\t.string " <> doubleQuotes (pprASCII bs)
-- | Emit a ".incbin" directive
--
-- A NULL byte is added after the binary data.
--
pprBytes :: ByteString -> SDoc
pprBytes bs = sdocWithDynFlags $ \dflags ->
if binBlobThreshold dflags == 0
|| fromIntegral (BS.length bs) <= binBlobThreshold dflags
then text "\t.string " <> doubleQuotes (pprASCII bs)
else unsafePerformIO $ do
bFile <- newTempName dflags TFL_CurrentModule ".dat"
BS.writeFile bFile bs
return $ text "\t.incbin "
<> pprFilePathString bFile -- proper escape (see #16389)
<> text "\n\t.byte 0"
pprFileEmbed :: FilePath -> SDoc
pprFileEmbed path
= text "\t.incbin "
<> pprFilePathString path -- proper escape (see #16389)
<> text "\n\t.byte 0"
{-
Note [Embedding large binary blobs]
......
......@@ -342,7 +342,7 @@ generateJumpTableForInstr :: Platform -> Instr
-> Maybe (NatCmmDecl RawCmmStatics Instr)
generateJumpTableForInstr platform (JMP_TBL _ ids label) =
let jumpTable = map (jumpTableEntry platform) ids
in Just (CmmData (Section ReadOnlyData label) (RawCmmStatics label jumpTable))
in Just (CmmData (Section ReadOnlyData label) (CmmStaticsRaw label jumpTable))
generateJumpTableForInstr _ _ = Nothing
......
......@@ -86,7 +86,7 @@ getRegister (CmmLit (CmmFloat f W32)) = do
let code dst = toOL [
-- the data area
LDATA (Section ReadOnlyData lbl) $ RawCmmStatics lbl
LDATA (Section ReadOnlyData lbl) $ CmmStaticsRaw lbl
[CmmStaticLit (CmmFloat f W32)],
-- load the literal
......@@ -99,7 +99,7 @@ getRegister (CmmLit (CmmFloat d W64)) = do
lbl <- getNewLabelNat
tmp <- getNewRegNat II32
let code dst = toOL [
LDATA (Section ReadOnlyData lbl) $ RawCmmStatics lbl
LDATA (Section ReadOnlyData lbl) $ CmmStaticsRaw lbl
[CmmStaticLit (CmmFloat d W64)],
SETHI (HI (ImmCLbl lbl)) tmp,
LD II64 (AddrRegImm tmp (LO (ImmCLbl lbl))) dst]
......
......@@ -67,7 +67,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
pprLabel platform lbl $$ -- blocks guaranteed not null, so label needed
vcat (map (pprBasicBlock platform top_info) blocks)
Just (RawCmmStatics info_lbl _) ->
Just (CmmStaticsRaw info_lbl _) ->
(if platformHasSubsectionsViaSymbols platform
then pprSectionAlign config dspSection $$
ppr (mkDeadStripPreventer info_lbl) <> char ':'
......@@ -96,7 +96,7 @@ pprBasicBlock platform info_env (BasicBlock blockid instrs)
where
maybe_infotable = case mapLookup blockid info_env of
Nothing -> empty
Just (RawCmmStatics info_lbl info) ->
Just (CmmStaticsRaw info_lbl info) ->
pprAlignForSection Text $$
vcat (map (pprData platform) info) $$
pprLabel platform info_lbl
......@@ -104,7 +104,7 @@ pprBasicBlock platform info_env (BasicBlock blockid instrs)
pprDatas :: Platform -> RawCmmStatics -> SDoc
-- See note [emit-time elimination of static indirections] in CLabel.
pprDatas _platform (RawCmmStatics alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
pprDatas _platform (CmmStaticsRaw alias [CmmStaticLit (CmmLabel lbl), CmmStaticLit ind, _, _])
| lbl == mkIndStaticInfoLabel
, let labelInd (CmmLabelOff l _) = Just l
labelInd (CmmLabel l) = Just l
......@@ -113,12 +113,14 @@ pprDatas _platform (RawCmmStatics alias [CmmStaticLit (CmmLabel lbl), CmmStaticL
, alias `mayRedirectTo` ind'
= pprGloblDecl alias
$$ text ".equiv" <+> ppr alias <> comma <> ppr (CmmLabel ind')
pprDatas platform (RawCmmStatics lbl dats) = vcat (pprLabel platform lbl : map (pprData platform) dats)
pprDatas platform (CmmStaticsRaw lbl dats) = vcat (pprLabel platform lbl : map (pprData platform) dats)
pprData :: Platform -> CmmStatic -> SDoc
pprData _ (CmmString str) = pprBytes str
pprData _ (CmmUninitialised bytes) = text ".skip " <> int bytes
pprData platform (CmmStaticLit lit) = pprDataItem platform lit
pprData platform d = case d of
CmmString str -> pprString str
CmmFileEmbed path -> pprFileEmbed path
CmmUninitialised bytes -> text ".skip " <> int bytes
CmmStaticLit lit -> pprDataItem platform lit
pprGloblDecl :: CLabel -> SDoc
pprGloblDecl lbl
......
......@@ -44,8 +44,8 @@ shortcutJump _ other = other
shortcutStatics :: (BlockId -> Maybe JumpDest) -> RawCmmStatics -> RawCmmStatics
shortcutStatics fn (RawCmmStatics lbl statics)
= RawCmmStatics lbl $ map (shortcutStatic fn) statics
shortcutStatics fn (CmmStaticsRaw lbl statics)
= CmmStaticsRaw lbl $ map (shortcutStatic fn) statics
-- we need to get the jump tables, so apply the mapping to the entries
-- of a CmmData too.
......