- Dec 05, 2024
-
-
Luite Stegeman authored
remove dead note reference
-
- Dec 04, 2024
-
-
Luite Stegeman authored
-
- Dec 03, 2024
-
-
Luite Stegeman authored
-
This is a partial backport of the treatment given to modules names in !10448, removing the dependence of BRK_FUN on the representation of `Unique`. (cherry picked from commit ea2ea2d5)
-
In #22010 we established that Int was not always sufficient to store all the uniques we generate during compilation on 32-bit platforms. This commit addresses that problem by using Word64 instead of Int for uniques. The core of the change is in GHC.Core.Types.Unique and GHC.Core.Types.Unique.Supply. However, the representation of uniques is used in many other places, so those needed changes too. Additionally, the RTS has been extended with an atomic_inc64 operation. One major change from this commit is the introduction of the Word64Set and Word64Map data types. These are adapted versions of IntSet and IntMap from the containers package. These are planned to be upstreamed in the future. As a natural consequence of these changes, the compiler will be a bit slower and take more space on 32-bit platforms. Our CI tests indicate around a 5% residency increase. Metric Increase: CoOpt_Read CoOpt_Singletons LargeRecord ManyAlternatives ManyConstructors MultiComponentModules MultiComponentModulesRecomp MultiLayerModulesTH_OneShot RecordUpdPerf T10421 T10547 T12150 T12227 T12234 T12425 T12707 T13035 T13056 T13253 T13253-spj T13379 T13386 T13719 T14683 T14697 T14766 T15164 T15703 T16577 T16875 T17516 T18140 T18223 T18282 T18304 T18698a T18698b T18923 T1969 T19695 T20049 T21839c T3064 T3294 T4801 T5030 T5321FD T5321Fun T5631 T5642 T5837 T6048 T783 T8095 T9020 T9198 T9233 T9630 T9675 T9872a T9872b T9872b_defer T9872c T9872d T9961 TcPlugin_RewritePerf UniqLoop WWRec hard_hole_fits (cherry picked from commit 9edcb1fb)
-
- Dec 02, 2024
-
-
Luite Stegeman authored
-
- Nov 27, 2024
-
-
This applies the same treatment to `prompt#` as for `catch#`. See `Note [Strictness for mask/unmask/catch/prompt]`. Fixes #25439. (cherry picked from commit 00d58ae1)
-
This patch fixes an unnoticed undefined behavior in the bytecode interpreter. It can be caught by building `rts/Interpreter.c` with `-fsanitize=pointer-overflow`, the warning message is something like: ``` rts/Interpreter.c:1369:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1369:13 rts/Interpreter.c:1265:13: runtime error: addition of unsigned offset to 0x004200197660 overflowed to 0x004200197658 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1265:13 rts/Interpreter.c:1645:13: runtime error: addition of unsigned offset to 0x0042000b22f8 overflowed to 0x0042000b22f0 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Interpreter.c:1645:13 ``` Whenever we do something like `SpW(-1)`, the negative argument is implicitly converted to an unsigned integer type and causes pointer arithmetic overflow. It happens to be harmless for most targets since overflowing would wrap the result to desired value, but it's still coincidental and undefined behavior. Furthermore, it causes real damage to the wasm backend, given clang-20 will emit invalid wasm code that crashes at run-time for this kind of C code! (see https://github.com/llvm/llvm-project/issues/108770) The fix here is adding some explicit casts to ensure we always use the signed `ptrdiff_t` type as right hand operand of pointer arithmetic. (cherry picked from commit 5bcfefd5)
-
This MR fixes #25325 See GHC.Tc.Types.Constraint, Note [Insoluble Wanteds], especially (IW2) There is a small change in the error message for T14172, but it looks entirely acceptable to me. (cherry picked from commit 083703a1)
-
- Nov 19, 2024
-
-
A kqueue file descriptor isn't inherited by a child created with fork. As such we mustn't try to close this file descriptor as we would close a random one, e.g. the one used by timerfd. Fix #24672 (cherry picked from commit e7a26d7a)
-
-working-dir definitely needs more serious testing, there are some easy ways to test this. * Modify Cabal to call ghc using -working-dir rather than changing directory. * Modify the testsuite to run ghc using `-working-dir` rather than running GHC with cwd = temporary directory. However this will have to wait until after 9.12. Fixes #25150 (cherry picked from commit c20d5186)
-
Support for rubbish dynamic literals was added in #24664. This patch does the same for static literals. Fix #25177 (cherry picked from commit 5092dbff)
-
This patch is part of the patches upstreamed from haskell.nix. See https://github.com/input-output-hk/haskell.nix/pull/1960 for the original report/patch. (cherry picked from commit c749bdfd)
-
- beef6135 enabled the use of MO_Add/MO_Sub for 64-bit operations in the C and LLVM backends - 6755d833 did the same for the x86 NCG backend However we store some literal values as `Int` in the compiler. As a result, some Cmm optimizations transformed target 64-bit literals into compiler `Int`. If the compiler is 32-bit, this leads to computing with wrong literals (see #24893 and #24700). This patch disables these Cmm optimizations for 32-bit compilers. This is unsatisfying (optimizations shouldn't be compiler-word-size dependent) but it fixes the bug and it makes the patch easy to backport. A proper fix would be much more invasive but it shall be implemented in the future. Co-authored-by:
amesgen <amesgen@amesgen.de> (cherry picked from commit 7446a09a)
-
It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 (cherry picked from commit 951ce3d5)
-
See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify (cherry picked from commit de5d9852)
-
part of the upstream haskell.nix patches (cherry picked from commit bfe4b3d3)
-
It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. (cherry picked from commit 3f89ab92)
-
Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 (cherry picked from commit a82121b3)
-
Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). (cherry picked from commit c34fef56)
-
(cherry picked from commit 52d66984)
-
Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). (cherry picked from commit 5104ee61)
-
This patch fixes an error message in checkClosure() when the closure has already been evacuated. The previous logic was meant to print the evacuated closure's type in the error message, but it was completely wrong, given info was not really an info table, but a tagged pointer that points to the closure's new address. (cherry picked from commit 0d3bc2fa)
-
We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 (cherry picked from commit dddc9dff)
-
Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by:
Ryan Scott <ryan.gl.scott@gmail.com> (cherry picked from commit 5e4f4ba8)
-
Fixes #24487 (cherry picked from commit 23c3e624)
-
Check for ptr/int arguments rather than 64-bit width arguments when counting integer register arguments. The old approach broke when we stopped using exclusively W64-sized types to represent sub-word sized integers. Fixes #24314 (cherry picked from commit de589554)
-
Fixes #24266 (cherry picked from commit 6f0a62db)
-
(cherry picked from commit 18498538)
-
Fixes ghc/ghc#23444 (cherry picked from commit 70526f5b)
-
This patch moves ACQUIRE_ALLOC_BLOCK_SPIN_LOCK/RELEASE_ALLOC_BLOCK_SPIN_LOCK from Storage.h to HeapAlloc.h. When --disable-large-address-space is passed to configure, the code in HeapAlloc.h makes use of these two macros. Fixes #23385. (cherry picked from commit a8f0435f)
-
Per the new `Note [Linting linearity]`, we want optimisations over trying to preserve linearity. This will allow CPR to handle `Ur`, in particular. (cherry picked from commit 981e5e11)
-
Per the new `Note [Linting linearity]`, we want optimisations over trying to preserve linearity. This will avoid preventing inlinings and reductions and make linear programs more efficient. (cherry picked from commit bf9344d2)
-
- Jun 30, 2024
- Jun 28, 2024
-
-
The duplication between `exprIsTrivial` and `getIdFromTrivialExpr_maybe` has been bugging me for a long time. This patch introduces an inlinable worker function `trivial_expr_fold` acting as the single, shared decision procedure of triviality. It "returns" a Church-encoded `Maybe (Maybe Id)`, so when it is inlined, it fuses to similar code as before. (Better code, even, in the case of `getIdFromTrivialExpr` which presently allocates a `Just` constructor that cancels away after this patch.) (cherry picked from commit 9cb7e73a)
-
Zubin authored
-
Sign hints for parameters are in the second component of the pair. Fixes #23034 (cherry picked from commit 7fe85b13)