summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Starting coercion opt for TransCoDCowip/amg/dcoercion-TransCoDCoAdam Gundry2022-10-313-11/+85
|
* Cache the RHS typeAdam Gundry2022-10-2714-39/+42
|
* TransCoDCoAdam Gundry2022-10-2718-3/+133
|
* Hack out HydrateDCoAdam Gundry2022-10-2715-185/+5
|
* Hack out changes to reduction and coercion optAdam Gundry2022-10-2718-1505/+725
|
* Directed coercionsAdam Gundry2022-10-2270-1147/+4611
| | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce a slimmer version of coercions, directed coercions, which store fewer types within them. This more compact representation considerably speeds up programs which involve many type family reductions, as the coercion size no longer grows quadratically in the number of reduction steps. ------------------------- Metric Decrease: T12227 T12545 T12707 T5030 T9872d Metric Increase: T18223 T9872a T9872b T9872c TcPlugin_RewritePerf Metric Decrease 'compile_time/bytes allocated': T3064 Metric Increase 'compile_time/peak_megabytes_allocated': T3064 -------------------------
* TyEq:N assertion: only for saturated applicationssheaf2022-10-194-6/+41
| | | | | | | | | | The assertion that checked TyEq:N in canEqCanLHSFinish incorrectly triggered in the case of an unsaturated newtype TyCon heading the RHS, even though we can't unwrap such an application. Now, we only trigger an assertion failure in case of a saturated application of a newtype TyCon. Fixes #22310
* Fix typo in `Opt_WriteIfSimplifiedCore`'s nameGergő Érdi2022-10-194-7/+7
|
* Small language fixes in 'Using GHC'Jan Hrček2022-10-191-6/+6
|
* Add SpliceTypes test for hie filesMatthew Pickering2022-10-193-0/+57
| | | | | | | This test checks that typed splices and quotes get the right type information when used in hiefiles. See #21619
* Rename unsafeOverlap_matches -> unsafeOverlap_match in UnsafeOverlapsheaf2022-10-193-6/+4
|
* More precise types for fields of OverlappingInstances and UnsafeOverlap in ↵Bodigrim2022-10-193-34/+23
| | | | | | | | | | TcSolverReportMsg It's clear from asserts in `GHC.Tc.Errors` that `overlappingInstances_matches` and `unsafeOverlapped` are supposed to be non-empty, and `unsafeOverlap_matches` contains a single instance, but these invariants are immediately lost afterwards and not encoded in types. This patch enforces the invariants by pattern matching and makes types more precise, avoiding asserts and partial functions such as `head`.
* Enforce invariant of `ListBag` constructor.M Farkas-Dyck2022-10-193-36/+65
|
* Scrub various partiality involving lists (again).M Farkas-Dyck2022-10-1931-157/+184
| | | | Lets us avoid some use of `head` and `tail`, and some panics.
* Disable some SIMD tests on non-X86 architecturessheaf2022-10-192-2/+4
|
* Cmm Lint: relax SIMD register assignment checksheaf2022-10-192-5/+18
| | | | | | | | | | As noted in #22297, SIMD vector registers can be used to store different kinds of values, e.g. xmm1 can be used both to store integer and floating point values. The Cmm type system doesn't properly account for this, so we weaken the Cmm register assignment lint check to only compare widths when comparing a vector type with its allocated vector register.
* Remove SIMD conversionssheaf2022-10-196-71/+74
| | | | | | | | | | | This patch makes it so that packing/unpacking SIMD vectors always uses the right sized types, e.g. unpacking a Word16X4# will give a tuple of Word16#s. As a result, we can get rid of the conversion instructions that were previously required. Fixes #22296
* Add VecSlot for unboxed sums of SIMD vectorsDai2022-10-198-4/+73
| | | | | | | | | This patch adds the missing `VecRep` case to `primRepSlot` function and all the necessary machinery to carry this new `VecSlot` through code generation. This allows programs involving unboxed sums of SIMD vectors to be written and compiled. Fixes #22187
* Add -fsuppress-error-contexts to disable printing error contexts in errorswip/diagnostics-configMatthew Pickering2022-10-189-10/+51
| | | | | | | | | | | | | In many development environments, the source span is the primary means of seeing what an error message relates to, and the In the expression: and In an equation for: clauses are not particularly relevant. However, they can grow to be quite long, which can make the message itself both feel overwhelming and interact badly with limited-space areas. It's simple to implement this flag so we might as well do it and give the user control about how they see their messages. Fixes #21722
* Allow configuration of error message printingMatthew Pickering2022-10-1832-122/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR implements the idea of #21731 that the printing of a diagnostic method should be configurable at the printing time. The interface of the `Diagnostic` class is modified from: ``` class Diagnostic a where diagnosticMessage :: a -> DecoratedSDoc diagnosticReason :: a -> DiagnosticReason diagnosticHints :: a -> [GhcHint] ``` to ``` class Diagnostic a where type DiagnosticOpts a defaultDiagnosticOpts :: DiagnosticOpts a diagnosticMessage :: DiagnosticOpts a -> a -> DecoratedSDoc diagnosticReason :: a -> DiagnosticReason diagnosticHints :: a -> [GhcHint] ``` and so each `Diagnostic` can implement their own configuration record which can then be supplied by a client in order to dictate how to print out the error message. At the moment this only allows us to implement #21722 nicely but in future it is more natural to separate the configuration of how much information we put into an error message and how much we decide to print out of it. Updates Haddock submodule
* Build System: Remove out-of-date comment about make build systemMatthew Pickering2022-10-181-4/+0
| | | | | | | | Both make and hadrian interleave compilation of modules of different modules and don't respect the package boundaries. Therefore I just remove this comment which points out this "difference". Fixes #22253
* configure: Bump minimum bootstrap GHC versionBen Gamari2022-10-181-2/+3
| | | | Fixes #22245
* Make `Functor` a superclass of `TrieMap`, which lets us derive the `map` ↵M Farkas-Dyck2022-10-185-91/+126
| | | | functions.
* Fix GHCis interaction with tag inference.Andreas Klebinger2022-10-1819-69/+177
| | | | | | | | | | | | | | | | | | | | | | | | | I had assumed that wrappers were not inlined in interactive mode. Meaning we would always execute the compiled wrapper which properly takes care of upholding the strict field invariant. This turned out to be wrong. So instead we now run tag inference even when we generate bytecode. In that case only for correctness not performance reasons although it will be still beneficial for runtime in some cases. I further fixed a bug where GHCi didn't tag nullary constructors properly when used as arguments. Which caused segfaults when calling into compiled functions which expect the strict field invariant to be upheld. Fixes #22042 and #21083 ------------------------- Metric Increase: T4801 Metric Decrease: T13035 -------------------------
* Fix T15155l not getting -fllvmKrzysztof Gogolewski2022-10-171-1/+1
|
* testsuite: Fix typo when setting llvm_waysMatthew Pickering2022-10-171-2/+1
| | | | | | | Since 2014 llvm_ways has been set to [] so none of the tests which use only_ways(llvm_ways) have worked as expected. Hopefully the tests still pass with this typo fix!
* use heredocEric Lindblad2022-10-171-3/+4
|
* remove redirectEric Lindblad2022-10-171-1/+1
|
* example rewriteEric Lindblad2022-10-171-2/+2
|
* Testsuite: Add a new tables_next_to_code predicate.Andreas Klebinger2022-10-175-1/+16
| | | | | | And use it to avoid T21710a failing on non-tntc archs. Fixes #22169
* Avoid allocating intermediate lists for non recursive bindings.Andreas Klebinger2022-10-178-14/+50
| | | | | | | We do so by having an explicit folding function that doesn't need to allocate intermediate lists first. Fixes #22196
* Update the check-exact infrastructure to match ghc-exactprintAlan Zimmerman2022-10-1717-3099/+3838
| | | | | | | | | | | | | | | | | | | | GHC tests the exact print annotations using the contents of utils/check-exact. The same functionality is provided via https://github.com/alanz/ghc-exactprint The latter was updated to ensure it works with all of the files on hackage when 9.2 was released, as well as updated to ensure users of the library could work properly (apply-refact, retrie, etc). This commit brings the changes from ghc-exactprint into GHC/utils/check-exact, adapting for the changes to master. Once it lands, it will form the basis for the 9.4 version of ghc-exactprint. See also discussion around this process at #21355
* Add `Enum (Down a)` instance that swaps `succ` and `pred`Gergo ERDI2022-10-172-2/+25
| | | | | | | | | | | See https://github.com/haskell/core-libraries-committee/issues/51 for discussion. The key points driving the implementation are the following two ideas: * For the `Int` type, `comparing (complement @Int)` behaves exactly as an order-swapping `compare @Int`. * `enumFrom @(Down a)` can be implemented in terms of `enumFromThen @a`, if only the corner case of starting at the very end is handled specially
* DmdAnal: Look through unfoldings of DataCon wrappers (#22241)Sebastian Graf2022-10-176-7/+111
| | | | | | | | | | | | | | | | | | Previously, the demand signature we computed upfront for a DataCon wrapper lacked boxity information and was much less precise than the demand transformer for the DataCon worker. In this patch we adopt the solution to look through unfoldings of DataCon wrappers during Demand Analysis, but still attach a demand signature for other passes such as the Simplifier. See `Note [DmdAnal for DataCon wrappers]` for more details. Fixes #22241.
* Add realease note for #21927Teo Camarasu2022-10-151-0/+6
|
* rts: trigger a major collection if megablock usage exceeds maxHeapSizeTeo Camarasu2022-10-151-1/+5
| | | | | | | | | | | When the heap is suffering from block fragmentation, live bytes might be low while megablock usage is high. If megablock usage exceeds maxHeapSize, we want to trigger a major GC to try to recover some memory otherwise we will die from a heapOverflow at the end of the GC. Fixes #21927
* rts: ensure we are below maxHeapSize after returning megablocksTeo Camarasu2022-10-151-0/+7
| | | | | | | | | When the heap is heavily block fragmented the live byte size might be low while the memory usage is high. We want to ensure that heap overflow triggers in these cases. We do so by checking that we can return enough megablocks to under maxHeapSize at the end of GC.
* ncg/aarch64: Fix sub-word sign extension yet againBen Gamari2022-10-141-12/+20
| | | | | | | | | | | | | | | | | | | | | | In adc7f108141a973b6dcb02a7836eed65d61230e8 we fixed a number of issues to do with sign extension in the AArch64 NCG found by ghc/test-primops>. However, this patch made a critical error, assuming that getSomeReg would allocate a fresh register for the result of its evaluation. However, this is not the case as `getSomeReg (CmmReg r) == r`. Consequently, any mutation of the register returned by `getSomeReg` may have unwanted side-effects on other expressions also mentioning `r`. In the fix listed above, this manifested as the registers containing the operands of binary arithmetic operations being incorrectly sign-extended. This resulted in #22282. Sadly, the rather simple structure of the tests generated by `test-primops` meant that this particular case was not exercised. Even more surprisingly, none of our testsuite caught this case. Here we fix this by ensuring that intermediate sign extension is performed in a fresh register. Fixes #22282.
* testsuite: Add test for #22282Ben Gamari2022-10-144-0/+24
| | | | | | This will complement mpickering's more general port of foundation's numerical testsuite, providing a test for the specific case found in #22282.
* rts: Use pthread_setname_np correctly on DarwinBen Gamari2022-10-141-10/+36
| | | | | | As noted in #22206, pthread_setname_np on Darwin only supports setting the name of the calling thread. Consequently we must introduce a trampoline which first sets the thread name before entering the thread entrypoint.
* Add type signatures in where-clause of Data.List.permutationsBodigrim2022-10-141-7/+12
| | | | The type of interleave' is very much revealing, otherwise it's extremely tough to decipher.
* Add standard Unicode case predicates isUpperCase and isLowerCase.Pierre Le Marre2022-10-1412-51/+200
| | | | | | | | These predicates use the standard Unicode case properties and are more intuitive than isUpper and isLower. Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/90#issuecomment-1276649403. Fixes #14589
* Clearer error msg for newtype GADTs with defaulted kindFinley McIlwaine2022-10-1318-75/+157
| | | | | | | | | | | When a newtype introduces GADT eq_specs due to a defaulted RuntimeRep, we detect this and print the error message with explicit kinds. This also refactors newtype type checking to use the new diagnostic infra. Fixes #21447
* Update phases.rst Simon Hengel2022-10-131-2/+2
| | | (the name of the original source file is $1, not $2)
* rts/linker: Add support for .fini sectionsBen Gamari2022-10-133-0/+9
|
* rts/linker: Consolidate initializer/finalizer handlingBen Gamari2022-10-137-251/+316
| | | | | | | | | Here we extend our treatment of initializer/finalizer priorities to include ELF and in so doing refactor things to share the implementation with PEi386. As well, I fix a subtle misconception of the ordering behavior for `.ctors`. Fixes #21847.
* Add a perf test for the generics code pattern from #21839.Andreas Klebinger2022-10-136-0/+109
| | | | | | | | | This code showed a strong shift between compile time (got worse) and run time (got a lot better) recently which is perfectly acceptable. However it wasn't clear why the compile time regression was happening initially so I'm adding this test to make it easier to track such changes in the future.
* Unrestricted OverloadedLabels (#11671)Charles Taylor2022-10-125-33/+135
| | | | | Implements GHC proposal: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0170-unrestricted-overloadedlabels.rst
* winio: do not re-translate input when handle is uncookedTamar Christina2022-10-121-22/+32
|
* remove name shadowingCurran McConnell2022-10-121-8/+7
|