summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* compiler: Record original thunk info tables on stackwip/orig-thunk-infoBen Gamari2023-05-1010-5/+86
|
* compiler: Fingerprint more code generation flagsBen Gamari2023-05-103-15/+51
| | | | | | | | | | Previously our recompilation check was quite inconsistent in its coverage of non-optimisation code generation flags. Specifically, we failed to account for most flags that would affect the behavior of generated code in ways that might affect the result of a program's execution (e.g. `-feager-blackholing`, `-fstrict-dicts`) Closes #23369.
* Bump hsc2hs submoduleCheng Shao2023-05-101-0/+0
| | | | Fixes #22981.
* ghc-prim: Generalize keepAlive#/touch# in state token typeBen Gamari2023-05-102-2/+4
| | | | Closes #23163.
* Make `(&)` representation polymorphic in the return typekonsumlamm2023-05-092-4/+7
|
* Adjust AArch64 stackFrameHeaderSizeSven Tennie2023-05-091-7/+6
| | | | | The prologue of each stack frame are the saved LR and FP registers, 8 byte each. I.e. the size of the stack frame header is 2 * 8 byte.
* nonmoving: Account for mutator allocations in bytes_allocatedBen Gamari2023-05-093-1/+7
| | | | | | | | | Previously we failed to account direct mutator allocations into the nonmoving heap against the mutator's allocation limit and `cap->total_allocated`. This only manifests during CAF evaluation (since we allocate the CAF's blackhole directly into the nonmoving heap). Fixes #23312.
* Add a regression test for #21050Krzysztof Gogolewski2023-05-093-0/+38
|
* JS: add GHC.JS.Optimizer, remove RTS.Printer, add Linker.Optdoyougnu2023-05-0919-395/+782
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR changes some simple optimizations and is a first step in re-architecting the JS backend pipeline to add the optimizer. In particular it: - removes simple peep hole optimizations from `GHC.StgToJS.Printer` and removes that module - adds module `GHC.JS.Optimizer` - defines the same peep hole opts that were removed only now they are `Syntax -> Syntax` transformations rather than `Syntax -> JS code` optimizations - hooks the optimizer into code gen - adds FuncStat and ForStat constructors to the backend. Working Ticket: - #22736 Related MRs: - MR !10142 - MR !10000 ------------------------- Metric Decrease: CoOpt_Read ManyAlternatives PmSeriesS PmSeriesT PmSeriesV T10421 T12707 T13253 T13253-spj T15164 T17516 T18140 T18282 T18698a T18698b T18923 T1969 T19695 T20049 T3064 T5321FD T5321Fun T783 T9198 T9233 T9630 -------------------------
* Make atomicSwapMutVar# an inline primopwip/ioref-swap-xchgBen Gamari2023-05-095-24/+20
|
* compiler: Implement atomicSwapIORef with xchgBen Gamari2023-05-098-6/+26
| | | | As requested by @treeowl in CLC#139.
* testsuite: Add test for atomicSwapIORefBen Gamari2023-05-093-0/+14
|
* Fix up rules for ghcup-metadata-nightly-pushBryan Richter2023-05-091-5/+2
|
* Add structured error messages for GHC.IfaceToCoreTorsten Schmits2023-05-084-6/+10
| | | | | | | | | Tracking ticket: #20114 MR: !10390 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* rts: Fix data-race in hs_init_ghcwip/T22756Ben Gamari2023-05-081-8/+11
| | | | | | | | As noticed by @Terrorjack, `hs_init_ghc` previously used non-atomic increment/decrement on the RTS's initialization count. This may go wrong in a multithreaded program which initializes the runtime multiple times. Closes #22756.
* Add structured error messages for GHC.Rename.ModuleTorsten Schmits2023-05-0523-129/+282
| | | | | | | | | | | Tracking ticket: #20115 MR: !10361 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`. Only addresses the single warning missing from the previous MR.
* docs: Remove mentions of ArrayArray# from unlifted FFI sectionRodrigo Mesquita2023-05-051-21/+18
| | | | Fixes #23277
* Incrementally update ghcup metadata in ghc/ghcup-metadataMatthew Pickering2023-05-051-1/+32
| | | | | | | | | | | | | | | | | | This job paves the way for distributing nightly builds * A new repo https://gitlab.haskell.org/ghc/ghcup-metadata stores the metadata on the "updates" branch. * Each night this metadata is downloaded and the nightly builds are appended to the end of the metadata. * The update job only runs on the scheduled nightly pipeline, not just when NIGHTLY=1. Things which are not done yet * Modify the retention policy for nightly jobs * Think about building release flavour compilers to distribute nightly. Fixes #23334
* docs: Add Note [Timing of plugin initialization]Matthew Pickering2023-05-053-0/+25
|
* Rework plugin initialisation pointsAaron Allen2023-05-0516-22/+130
| | | | | | | | | | | | | | | | | | In general this patch pushes plugin initialisation points to earlier in the pipeline. As plugins can modify the `HscEnv`, it's imperative that the plugins are initialised as soon as possible and used thereafter. For example, there are some new tests which modify hsc_logger and other hooks which failed to fire before (and now do) One consequence of this change is that the error for specifying the usage of a HPT plugin from the command line has changed, because it's now attempted to be loaded at initialisation rather than causing a cyclic module import. Closes #21279 Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
* driver: Use hooks from plugin_hsc_envMatthew Pickering2023-05-051-1/+1
| | | | | | This fixes a bug in oneshot mode where hooks modified in a plugin wouldn't be used in oneshot mode because we neglected to use the right hsc_env. This was observed by @csabahruska.
* Use TemplateHaskellQuotes in TH.Syntax to construct NamesOleg Grenrus2023-05-051-25/+14
|
* Add structured error messages for GHC.Rename.UtilsTorsten Schmits2023-05-05126-390/+622
| | | | | | | | | Tracking ticket: #20115 MR: !10350 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Fix type variable substitution in gen_Newtype_fam_instsRyan Scott2023-05-045-9/+96
| | | | | | | | | | | | | Previously, `gen_Newtype_fam_insts` was substituting the type variable binders of a type family instance using `substTyVars`, which failed to take type variable dependencies into account. There is similar code in `GHC.Tc.TyCl.Class.tcATDefault` that _does_ perform this substitution properly, so this patch: 1. Factors out this code into a top-level `substATBndrs` function, and 2. Uses `substATBndrs` in `gen_Newtype_fam_insts`. Fixes #23329.
* Improved documentation for the Data.OldList.nub functionAndrei Borzenkov2023-05-041-3/+9
| | | | | | There was recomentation to use map head . group . sort instead of nub function, but containers library has more suitable and efficient analogue
* linear types: Don't add external names to the usage envKrzysztof Gogolewski2023-05-043-6/+12
| | | | This has no observable effect, but avoids storing useless data.
* base/encoding: add an allocations performance test (#22946)Josh Meredith2023-05-042-0/+39
|
* JavaScript: Correct arguments to h$appendToHsStringALuite Stegeman2023-05-041-1/+1
| | | | fixes #23278
* Fix remaining issues with bound checking (#23123)Sylvain Henry2023-05-049-577/+569
| | | | | | | | | | | | | | | | | | | | While fixing these I've also changed the way we store addresses into ByteArray#. Addr# are composed of two parts: a JavaScript array and an offset (32-bit number). Suppose we want to store an Addr# in a ByteArray# foo at offset i. Before this patch, we were storing both fields as a tuple in the "arr" array field: foo.arr[i] = [addr_arr, addr_offset]; Now we only store the array part in the "arr" field and the offset directly in the array: foo.dv.setInt32(i, addr_offset): foo.arr[i] = addr_arr; It avoids wasting space for the tuple.
* JS: fix bounds checking (Issue 23123)Josh Meredith2023-05-044-112/+183
| | | | | | | | | | | | | | | | | | | | * For ByteArray-based bounds-checking, the JavaScript backend must use the `len` field, instead of the inbuild JavaScript `length` field. * Range-based operations must also check both the start and end of the range for bounds * All indicies are valid for ranges of size zero, since they are essentially no-ops * For cases of ByteArray accesses (e.g. read as Int), the end index is (i * sizeof(type) + sizeof(type) - 1), while the previous implementation uses (i + sizeof(type) - 1). In the Int32 example, this is (i * 4 + 3) * IndexByteArrayOp_Word8As* primitives use byte array indicies (unlike the previous point), but now check both start and end indicies * Byte array copies now check if the arrays are the same by identity and then if the ranges overlap.
* Use hash-unit-ids in release jobsMatthew Pickering2023-05-043-11/+29
| | | | Includes fix upload_ghc_libs glob
* Add hashes to unit-ids created by hadrianromes2023-05-0454-140/+740
| | | | | | | | | | | This commit adds support for computing an inputs hash for packages compiled by hadrian. The result is that ABI incompatible packages should be given different hashes and therefore be distinct in a cabal store. Hashing is enabled by the `--flag`, and is off by default as the hash contains a hash of the source files. We enable it when we produce release builds so that the artifacts we distribute have the right unit ids.
* Validate compatibility of ghcs when loading pluginsromes2023-05-041-6/+13
| | | | | | | Ensure, when loading plugins, that the ghc the plugin depends on is the ghc loading the plugin -- otherwise fail to load the plugin. Progress towards #20742.
* Hardwire a better unit-id for ghcromes2023-05-049-21/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the unit-id of ghc-the-library was fixed as `ghc`. This was done primarily because the compiler must know the unit-id of some packages (including ghc) a-priori to define wired-in names. However, as seen in #20742, a reinstallable `ghc` whose unit-id is fixed to `ghc` might result in subtle bugs when different ghc's interact. A good example of this is having GHC_A load a plugin compiled by GHC_B, where GHC_A and GHC_B are linked to ghc-libraries that are ABI incompatible. Without a distinction between the unit-id of the ghc library GHC_A is linked against and the ghc library the plugin it is loading was compiled against, we can't check compatibility. This patch gives a slightly better unit-id to ghc (ghc-version) by (1) Not setting -this-unit-id to ghc, but rather to the new unit-id (modulo stage0) (2) Adding a definition to `GHC.Settings.Config` whose value is the new unit-id. (2.1) `GHC.Settings.Config` is generated by Hadrian (2.2) and also by cabal through `compiler/Setup.hs` This unit-id definition is imported by `GHC.Unit.Types` and used to set the wired-in unit-id of "ghc", which was previously fixed to "ghc" The commits following this one will improve the unit-id with a cabal-style package hash and check compatibility when loading plugins. Note that we also ensure that ghc's unit key matches unit id both when hadrian or cabal builds ghc, and in this way we no longer need to add `ghc` to the WiringMap.
* hadrian: Flavour: Change args -> extraArgsMatthew Pickering2023-05-0415-28/+30
| | | | | | | | | | | | | Previously in a flavour definition you could override all the flags which were passed to GHC. This causes issues when needed to compute a package hash because we need to know what these extra arguments are going to be before computing the hash. The solution is to modify flavour so that the arguments you pass here are just extra ones rather than all the arguments that you need to compile something. This makes things work more like how cabal.project files work when you give extra arguments to a package and also means that flavour transformers correctly affect the hash.
* Fix unlit path in cross bindistsamesgen2023-05-031-1/+1
|
* Don't forget to check the parent in an export listsheaf2023-05-034-26/+29
| | | | | | | | Commit 3f374399 introduced a bug which caused us to forget to include the parent of an export item of the form T(..) (that is, IEThingAll) when checking for duplicate exports. Fixes #23318
* Bump Cabal submodule (#22356)Sylvain Henry2023-05-031-0/+0
|
* Document instances of DoubleBodigrim2023-05-032-28/+94
|
* Add sized primitive literal syntaxBen Orchard2023-05-0326-334/+738
| | | | | | | | | | | | | | Adds a new LANGUAGE pragma ExtendedLiterals, which enables defining unboxed numeric literals such as `0xFF#Word8 :: Word8#`. Implements GHC proposal 0451: https://github.com/ghc-proposals/ghc-proposals/blob/b384a538b34f79d18a0201455b7b3c473bc8c936/proposals/0451-sized-literals.rst Fixes #21422. Bumps haddock submodule. Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io>
* Add structured error messages for GHC.Rename.NamesTorsten Schmits2023-04-3074-294/+552
| | | | | | | | | Tracking ticket: #20115 MR: !10336 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Add the Unsatisfiable classsheaf2023-04-2949-87/+1050
| | | | | | | | | This commit implements GHC proposal #433, adding the Unsatisfiable class to the GHC.TypeError module. This provides an alternative to TypeError for which error reporting is more predictable: we report it when we are reporting unsolved Wanted constraints. Fixes #14983 #16249 #16906 #18310 #20835
* JS: change GHC.JS.Transform.identsS/E/V to take a saturated IR (#23304)Josh Meredith2023-04-272-37/+34
|
* testsuite: wasm32-specific fixesCheng Shao2023-04-2714-22/+62
| | | | This patch includes all wasm32-specific testsuite fixes.
* testsuite: add missing annotations for some testsCheng Shao2023-04-275-8/+17
| | | | | | | This patch adds missing annotations (req_th, req_dynamic_lib_support, req_rts_linker) to some tests. They were discovered when testing wasm32, though it's better to be explicit about what features they require, rather than simply adding when(arch('wasm32'), skip).
* testsuite: add the req_host_target_ghc predicateCheng Shao2023-04-272-0/+20
| | | | | | | This patch adds the req_host_target_ghc predicate to the testsuite to assert the ghc compiler being tested can compile both host/target code. When testing cross GHCs this is not supported yet, but it may change in the future.
* testsuite: add the req_process predicateCheng Shao2023-04-2710-9/+25
| | | | | | This patch adds the req_process predicate to the testsuite to assert the platform has a process model, also marking tests that involve spawning processes as req_process. Also bumps hpc & process submodule.
* testsuite: add the req_ghc_with_threaded_rts predicateCheng Shao2023-04-279-12/+19
| | | | | | | This patch adds the req_ghc_with_threaded_rts predicate to the testsuite to assert the platform has threaded RTS, and mark some tests as req_ghc_with_threaded_rts. Also makes ghc_with_threaded_rts a config field instead of a global variable.
* testsuite: fix permission bits in copy_filesCheng Shao2023-04-272-1/+3
| | | | | | | | When the testsuite driver copy files instead of symlinking them, it should also copy the permission bits, otherwise there'll be permission denied errors. Also, enforce file copying when testing wasm32, since wasmtime doesn't handle host symlinks quite well (https://github.com/bytecodealliance/wasmtime/issues/6227).
* testsuite: exclude ghci ways if no rts linker is presentCheng Shao2023-04-272-1/+11
| | | | | | This patch implements logic to automatically exclude ghci ways when there is no rts linker. It's way better than having to annotate individual test cases.