summaryrefslogtreecommitdiff
path: root/utils/deriveConstants
Commit message (Collapse)AuthorAgeFilesLines
* Put PlatformConstants into PlatformSylvain Henry2020-07-251-6/+9
|
* Kill wORDS_BIGENDIAN and replace it with platformByteOrder (#17957)Sylvain Henry2020-04-011-1/+0
| | | | | | Metric Decrease: T13035 T1969
* DynFlags refactoring IIISylvain Henry2020-03-251-3/+0
| | | | | | | | | | | | | Use Platform instead of DynFlags when possible: * `tARGET_MIN_INT` et al. replaced with `platformMinInt` et al. * no more DynFlags in PreRules: added a new `RuleOpts` datatype * don't use `wORD_SIZE` in the compiler * make `wordAlignment` use `Platform` * make `dOUBLE_SIZE` a constant Metric Decrease: T13035 T1969
* rts: Give stack flags proper macrosBen Gamari2019-10-181-0/+3
| | | | | This were previously quite unclear and will change a bit under the non-moving collector so let's clear this up now.
* Minor refactoring in deriveConstantsÖmer Sinan Ağacan2019-09-071-42/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Mainly we now generate this data PlatformConstants = PlatformConstants { pc_CONTROL_GROUP_CONST_291 :: Int, pc_STD_HDR_SIZE :: Int, pc_PROF_HDR_SIZE :: Int, pc_BLOCK_SIZE :: Int, } instead of data PlatformConstants = PlatformConstants { pc_platformConstants :: () , pc_CONTROL_GROUP_CONST_291 :: Int , pc_STD_HDR_SIZE :: Int , pc_PROF_HDR_SIZE :: Int , pc_BLOCK_SIZE :: Int ... } The first field has no use and according to (removed) comments it was to make code generator's work easier.. if anything this version is simpler because it has less repetition (the commas in strings are gone).
* Inline `Settings` into `DynFlags`John Ericson2019-05-291-4/+4
| | | | | | | | | | After the previous commit, `Settings` is just a thin wrapper around other groups of settings. While `Settings` is used by GHC-the-executable to initalize `DynFlags`, in principle another consumer of GHC-the-library could initialize `DynFlags` a different way. It therefore doesn't make sense for `DynFlags` itself (library code) to separate the settings that typically come from `Settings` from the settings that typically don't.
* Clean up URLs to point to GitLabTakenobu Tani2019-04-011-1/+1
| | | | | | | | | | | | This moves URL references to old Trac to their corresponding GitLab counterparts. This patch does not update the submodule library, such as libraries/Cabal. See also !539, !606, !618 [ci skip]
* Update Wiki URLs to point to GitLabTakenobu Tani2019-03-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | This moves all URL references to Trac Wiki to their corresponding GitLab counterparts. This substitution is classified as follows: 1. Automated substitution using sed with Ben's mapping rule [1] Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy... New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy... 2. Manual substitution for URLs containing `#` index Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz 3. Manual substitution for strings starting with `Commentary` Old: Commentary/XxxYyy... New: commentary/xxx-yyy... See also !539 [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
* Finish stable splitDavid Feuer2018-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Long ago, the stable name table and stable pointer tables were one. Now, they are separate, and have significantly different implementations. I believe the time has come to finish the split that began in #7674. * Divide `rts/Stable` into `rts/StableName` and `rts/StablePtr`. * Give each table its own mutex. * Add FFI functions `hs_lock_stable_ptr_table` and `hs_unlock_stable_ptr_table` and document them. These are intended to replace the previously undocumented `hs_lock_stable_tables` and `hs_lock_stable_tables`, which are now documented as deprecated synonyms. * Make `eqStableName#` use pointer equality instead of unnecessarily comparing stable name table indices. Reviewers: simonmar, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15555 Differential Revision: https://phabricator.haskell.org/D5084
* rts: Rip out support for STM invariantsBen Gamari2018-06-021-7/+0
| | | | | | | | | | | | | | | | | | | | | | | This feature has some very serious correctness issues (#14310), introduces a great deal of complexity, and hasn't seen wide usage. Consequently we are removing it, as proposed in Proposal #77 [1]. This is heavily based on a patch from fryguybob. Updates stm submodule. [1] https://github.com/ghc-proposals/ghc-proposals/pull/77 Test Plan: Validate Reviewers: erikd, simonmar, hvr Reviewed By: simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14310 Differential Revision: https://phabricator.haskell.org/D4760
* Typos in comments and manualGabor Greif2017-03-061-1/+1
|
* Overhaul of Compact Regions (#12455)Simon Marlow2016-12-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit makes various improvements and addresses some issues with Compact Regions (aka Compact Normal Forms). This was the most important thing I wanted to fix. Compaction previously prevented GC from running until it was complete, which would be a problem in a multicore setting. Now, we compact using a hand-written Cmm routine that can be interrupted at any point. When a GC is triggered during a sharing-enabled compaction, the GC has to traverse and update the hash table, so this hash table is now stored in the StgCompactNFData object. Previously, compaction consisted of a deepseq using the NFData class, followed by a traversal in C code to copy the data. This is now done in a single pass with hand-written Cmm (see rts/Compact.cmm). We no longer use the NFData instances, instead the Cmm routine evaluates components directly as it compacts. The new compaction is about 50% faster than the old one with no sharing, and a little faster on average with sharing (the cost of the hash table dominates when we're doing sharing). Static objects that don't (transitively) refer to any CAFs don't need to be copied into the compact region. In particular this means we often avoid copying Char values and small Int values, because these are static closures in the runtime. Each Compact# object can support a single compactAdd# operation at any given time, so the Data.Compact library now enforces mutual exclusion using an MVar stored in the Compact object. We now get exceptions rather than killing everything with a barf() when we encounter an object that cannot be compacted (a function, or a mutable object). We now also detect pinned objects, which can't be compacted either. The Data.Compact API has been refactored and cleaned up. A new compactSize operation returns the size (in bytes) of the compact object. Most of the documentation is in the Haddock docs for the compact library, which I've expanded and improved here. Various comments in the code have been improved, especially the main Note [Compact Normal Forms] in rts/sm/CNF.c. I've added a few tests, and expanded a few of the tests that were there. We now also run the tests with GHCi, and in a new test way that enables sanity checking (+RTS -DS). There's a benchmark in libraries/compact/tests/compact_bench.hs for measuring compaction speed and comparing sharing vs. no sharing. The field totalDataW in StgCompactNFData was unnecessary. Test Plan: * new unit tests * validate * tested manually that we can compact Data.Aeson data Reviewers: gcampax, bgamari, ezyang, austin, niteria, hvr, erikd Subscribers: thomie, simonpj Differential Revision: https://phabricator.haskell.org/D2751 GHC Trac Issues: #12455
* Compact RegionsGiovanni Campagna2016-07-201-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This brings in initial support for compact regions, as described in the ICFP 2015 paper "Efficient Communication and Collection with Compact Normal Forms" (Edward Z. Yang et.al.) and implemented by Giovanni Campagna. Some things may change before the 8.2 release, but I (Simon M.) wanted to get the main patch committed so that we can iterate. What documentation there is is in the Data.Compact module in the new compact package. We'll need to extend and polish the documentation before the release. Test Plan: validate (new test cases included) Reviewers: ezyang, simonmar, hvr, bgamari, austin Subscribers: vikraman, Yuras, RyanGlScott, qnikst, mboes, facundominguez, rrnewton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1264 GHC Trac Issues: #11493
* rts: Add isPinnedByteArray# primopBen Gamari2016-05-181-0/+1
| | | | | | | | | | | | | | | | | Adds a primitive operation to determine whether a particular `MutableByteArray#` is backed by a pinned buffer. Test Plan: Validate with included testcase Reviewers: austin, simonmar Reviewed By: austin, simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2217 GHC Trac Issues: #12059
* Fix histograms for ticky codeMateusz Lenik2016-05-181-0/+3
| | | | | | | | | | | | | | | | | | | | This patch fixes Cmm generation required to produce histograms when compiling with -ticky flag, strips dead code from rts/Ticky.c and reworks it to use a shared constant in both C and Haskell code. Fixes #8308. Test Plan: T8308 Reviewers: jstolarek, simonpj, austin Reviewed By: simonpj Subscribers: mpickering, simonpj, bgamari, mlen, thomie, jstolarek Differential Revision: https://phabricator.haskell.org/D931 GHC Trac Issues: #8308
* deriveConstants: Fix nm advice one last timeBen Gamari2016-05-011-1/+1
| | | | Missing a close paren.
* Recommend more reliable recourse for broken nmBen Gamari2016-04-281-1/+1
| | | | | xcrun --find seems like the appropriate choice here. Thanks to Brandon Allbery for suggesting this.
* deriveConstants: Fix nm-classic error messageBen Gamari2016-04-241-1/+4
| | | | Thanks to George Colpitts for the suggestion.
* deriveConstants: Verify sanity of nmHerbert Valerio Riedel2016-04-161-2/+14
| | | | | | | | | | | | | Add a sanity check ensuring that nm emits valid hexadecimal output, as required by POSIX. See #11744 for motivation. Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2113 GHC Trac Issues: #11744
* Add Cabal synopses and descriptionsBen Gamari2016-01-051-2/+5
| | | | | | | | | | | | | | | | Various people (myself included) have complained about the lack of useful descriptions for the various packages included in GHC's source tree. Fix this. Test Plan: Validate Reviewers: austin, thomie Reviewed By: thomie Subscribers: angerman, ezyang Differential Revision: https://phabricator.haskell.org/D1736
* Fix warning about unused pattern variableGabor Greif2015-12-011-1/+1
|
* derivedConstants: Add support for AIXHerbert Valerio Riedel2015-11-191-2/+26
| | | | | | | | | | | | | | | On IBM AIX `nm` doesn't support reporting symbol sizes, so we need to resort to `objdump` instead, which has a peculiar output format on AIX. depends on D1499 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: kgardas, thomie Differential Revision: https://phabricator.haskell.org/D1500
* Make `derivedConstants` more crosscompile-friendlyHerbert Valerio Riedel2015-11-191-13/+27
| | | | | | | | | | | | | | | | | | `derivedConstants` currently uses `System.Info.os` for decisions (which doesn't necessarily reflect the build-target), as well as hardcoding "/usr/bin/objdump" for openbsd. This patch auto-detects `objdump` similiar to how `nm` is detected via Autoconf as well as passing the target-os into `derivedConstants` via commandline. Reviewers: austin, kgardas, erikd, bgamari Reviewed By: kgardas, erikd, bgamari Subscribers: kgardas, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1499
* Build system: cabalise deriveConstants + genprimopcodeThomas Miedema2015-10-303-3/+24
| | | | | | | | | This is needed for #10374 (but doesn't fix it yet). Also rename DeriveConstants.hs to Main.hs, because the build system has trouble with Main modules not called Main.hs. Differential Revision: https://phabricator.haskell.org/D1380
* s/StgArrWords/StgArrBytes/Siddhanathan Shanmugam2015-09-111-3/+3
| | | | | | | | | | Rename StgArrWords to StgArrBytes (see Trac #8552) Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1233 GHC Trac Issues: #8552
* Fix offset calculation in __stg_gc_funSimon Marlow2015-07-061-0/+1
| | | | | | | | | | | | | | Summary: We were not treating the offset as a signed field in this rare case, so it would blow up if the offset was negative. Test Plan: Looked at the assembly Reviewers: austin, bgamari, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1042
* comment about why this program existsSimon Marlow2014-12-151-1/+16
|
* Make clearNursery freeSimon Marlow2014-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: clearNursery resets all the bd->free pointers of nursery blocks to make the blocks empty. In profiles we've seen clearNursery taking significant amounts of time particularly with large -N and -A values. This patch moves the work of clearNursery to the point at which we actually need the new block, thereby introducing an invariant that blocks to the right of the CurrentNursery pointer still need their bd->free pointer reset. This should make things faster overall, because we don't need to clear blocks that we don't use. Test Plan: validate Reviewers: AndreasVoellmy, ezyang, austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D318
* Per-thread allocation counters and limitsSimon Marlow2014-11-121-0/+1
| | | | | | | | This reverts commit f0fcc41d755876a1b02d1c7c79f57515059f6417. New changes: now works on 32-bit platforms too. I added some basic support for 64-bit subtraction and comparison operations to the x86 NCG.
* Use objdump instead of nm to derive constants on OpenBSDAustin Seipp2014-10-211-1/+5
| | | | | | | | | | | | | | | | Summary: OpenBSD's nm doesn't support the -P option and there appears to be no other way to get the desired information from it. Reviewers: kgardas, #ghc, austin Reviewed By: kgardas, #ghc, austin Subscribers: austin, ggreif Projects: #ghc Differential Revision: https://phabricator.haskell.org/D332 GHC Trac Issues: #9549
* Per-capability nursery weak pointer lists, fixes #9075Edward Z. Yang2014-05-291-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Harden imports in `DeriveConstants.hs` moduleHerbert Valerio Riedel2014-05-201-12/+12
| | | | | | | | This was generated by applying `-ddump-minimal-imports` and addresses the current compile failure (see #9016) with GHC HEAD due to the new `die` being exported by `System.Exit` Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Extract derived constants from nm output for various OSes differently.Christian Maeder2014-05-181-22/+15
| | | | | | | | | | | | | Fixes #8783. In order to avoid querying the nm version that does not work on Mac OS X we use the "nm -P" output that is supposed to produce (more portable) POSIX output and works on all tested OSes (MinGW, Mac OS X, Solaris and Linux using GNU nm) although slightly different (as documented). The "nm -P" output is actually only needed to recognize the output of a non-GNU Solaris nm (all other OSes produce sane outut using "nm" only). Signed-off-by: Austin Seipp <austin@well-typed.com>
* Revert "Per-thread allocation counters and limits"Simon Marlow2014-05-041-1/+0
| | | | | | | | Problems were found on 32-bit platforms, I'll commit again when I have a fix. This reverts the following commits: 54b31f744848da872c7c6366dea840748e01b5cf b0534f78a73f972e279eed4447a5687bd6a8308e
* Per-thread allocation counters and limitsSimon Marlow2014-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This tracks the amount of memory allocation by each thread in a counter stored in the TSO. Optionally, when the counter drops below zero (it counts down), the thread can be sent an asynchronous exception: AllocationLimitExceeded. When this happens, given a small additional limit so that it can handle the exception. See documentation in GHC.Conc for more details. Allocation limits are similar to timeouts, but - timeouts use real time, not CPU time. Allocation limits do not count anything while the thread is blocked or in foreign code. - timeouts don't re-trigger if the thread catches the exception, allocation limits do. - timeouts can catch non-allocating loops, if you use -fno-omit-yields. This doesn't work for allocation limits. I couldn't measure any impact on benchmarks with these changes, even for nofib/smp.
* Add SmallArray# and SmallMutableArray# typesJohan Tibell2014-03-291-0/+3
| | | | | | | | | | | | | | | These array types are smaller than Array# and MutableArray# and are faster when the array size is small, as they don't have the overhead of a card table. Having no card table reduces the closure size with 2 words in the typical small array case and leads to less work when updating or GC:ing the array. Reduces both the runtime and memory allocation by 8.8% on my insert benchmark for the HashMap type in the unordered-containers package, which makes use of lots of small arrays. With tuned GC settings (i.e. `+RTS -A6M`) the runtime reduction is 15%. Fixes #8923.
* Revert "change deriveConstants to use nm in a POSIX way (fixes #8781)"Austin Seipp2014-03-241-10/+20
| | | | | | It causes a failure on Windows right now. This reverts commit 045b28033a33a48d31951240a8cb35f2b78345dc.
* change deriveConstants to use nm in a POSIX way (fixes #8781)Karel Gardas2014-03-221-20/+10
| | | | | | | The patch provided by Christian Maeder <Christian.Maeder@dfki.de> Signed-off-by: Karel Gardas <karel.gardas@centrum.cz> Signed-off-by: Austin Seipp <austin@well-typed.com>
* codeGen: allocate small byte arrays of statically known size inlineJohan Tibell2014-03-141-1/+1
| | | | | | | This results in a 57% runtime decrease when allocating an array of 128 bytes on a 64-bit machine. Fixes #8876.
* Implement shortcuts for slow calls (#6084)Simon Marlow2013-11-281-2/+2
|
* Revert "Implement shortcuts for slow calls that would require PAPs (#6084)"Austin Seipp2013-10-261-2/+2
| | | | This reverts commit 2f5db98e90cf0cff1a11971c85f108a7480528ed.
* Implement shortcuts for slow calls that would require PAPs (#6084)Simon Marlow2013-10-251-2/+2
|
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-012-4/+4
|
* Pass 512-bit-wide vectors in registers.Geoffrey Mainland2013-09-221-0/+6
|
* Pass 256-bit-wide vectors in registers.Geoffrey Mainland2013-09-221-0/+6
|
* Rename SSE -> XMM for consistency.Geoffrey Mainland2013-08-061-2/+2
| | | | | We were using SSE is some places and XMM in others. Better to keep a consistent naming scheme.
* Maintain per-generation lists of weak pointers (#7847)Takano Akio2013-06-151-0/+1
|
* Allow multiple C finalizers to be attached to a Weak#Takano Akio2013-06-151-4/+8
| | | | | | | | | | | | | The commit replaces mkWeakForeignEnv# with addCFinalizerToWeak#. This new primop mutates an existing Weak# object and adds a new C finalizer to it. This change removes an invariant in MarkWeak.c, namely that the relative order of Weak# objects in the list needs to be preserved across GC. This makes it easier to split the list into per-generation structures. The patch also removes a race condition between two threads calling finalizeWeak# on the same WEAK object at that same time.
* ticky enhancementsNicolas Frisby2013-03-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * the new StgCmmArgRep module breaks a dependency cycle; I also untabified it, but made no real changes * updated the documentation in the wiki and change the user guide to point there * moved the allocation enters for ticky and CCS to after the heap check * I left LDV where it was, which was before the heap check at least once, since I have no idea what it is * standardized all (active?) ticky alloc totals to bytes * in order to avoid double counting StgCmmLayout.adjustHpBackwards no longer bumps ALLOC_HEAP_ctr * I resurrected the SLOW_CALL counters * the new module StgCmmArgRep breaks cyclic dependency between Layout and Ticky (which the SLOW_CALL counters cause) * renamed them SLOW_CALL_fast_<pattern> and VERY_SLOW_CALL * added ALLOC_RTS_ctr and _tot ticky counters * eg allocation by Storage.c:allocate or a BUILD_PAP in stg_ap_*_info * resurrected ticky counters for ALLOC_THK, ALLOC_PAP, and ALLOC_PRIM * added -ticky and -DTICKY_TICKY in ways.mk for debug ways * added a ticky counter for total LNE entries * new flags for ticky: -ticky-allocd -ticky-dyn-thunk -ticky-LNE * all off by default * -ticky-allocd: tracks allocation *of* closure in addition to allocation *by* that closure * -ticky-dyn-thunk tracks dynamic thunks as if they were functions * -ticky-LNE tracks LNEs as if they were functions * updated the ticky report format, including making the argument categories (more?) accurate again * the printed name for things in the report include the unique of their ticky parent as well as if they are not top-level
* Automatically add the $(exeext) to program namesIan Lynagh2013-03-031-1/+1
| | | | | | | We now define _PROGNAME, and _PROG is automatically defined with $(exeext). This will shortly automatically use the right exeext depending on what stage it is being compiled with (exeext may be different for different stages when cross-compiling).