- Feb 06, 2025
-
-
Cheng Shao authored
-
(cherry picked from commit d69ecac2)
-
Cheng Shao authored
(cherry picked from commit 1fad5bf1)
-
Cheng Shao authored
(cherry picked from commit 280c49af)
-
Cheng Shao authored
(cherry picked from commit 94673d41) (cherry picked from commit f13a2942) (cherry picked from commit 97551107)
-
Cheng Shao authored
(cherry picked from commit 64fba310) (cherry picked from commit b35707a9) (cherry picked from commit ead1c3cc)
-
Cheng Shao authored
objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. (cherry picked from commit 595c0894) (cherry picked from commit 5273d3d0) (cherry picked from commit 6babf56f)
-
Cheng Shao authored
(cherry picked from commit e17f2df9) (cherry picked from commit 9a2f3313) (cherry picked from commit 08acf27f)
-
Cheng Shao authored
T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. (cherry picked from commit 7b4c1998) (cherry picked from commit c4060ce3) (cherry picked from commit b64e0f63)
-
Cheng Shao authored
(cherry picked from commit b1e0c313) (cherry picked from commit 34882192) (cherry picked from commit 94adf918)
-
Cheng Shao authored
Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. (cherry picked from commit d3a050d2) (cherry picked from commit 04860c24)
-
Cheng Shao authored
hs_try_putmvar002 includes pthread.h and doesn't work on targets without this header (e.g. wasm32). It doesn't need to include this header at all. This was previously unnoticed by wasm CI, though recent toolchain upgrade brought in upstream changes that completely removes pthread.h in the single-threaded wasm32-wasi sysroot, therefore we need to handle that change. (cherry picked from commit 2ce2a493) (cherry picked from commit f581edb0)
-
Cheng Shao authored
On posix platforms, when performing read/write on FDs, we check the nonblocking flag first. For FDs without this flag (e.g. stdout), we call fdReady() first, which in turn calls poll() to wait for I/O to be available on that FD. This is problematic for wasm32-wasi: although select()/poll() is supported via the poll_oneoff() wasi syscall, that syscall is rather heavyweight and runtime behavior differs in different wasi implementations. The issue is even worse when targeting browsers, given there's no satisfactory way to implement async I/O as a synchronous syscall, so existing JS polyfills for wasi often give up and simply return ENOSYS. Before we have a proper I/O manager that avoids poll_oneoff() for async I/O on wasm, this patch improves the status quo a lot by merely pretending all FDs are "nonblocking". Read/write on FDs will directly invoke read()/write(), which are much more reliably handled in existing wasi implementations, especially those in browsers. Fixes #23275 and the following test cases: T7773 isEOF001 openFile009 T4808 cgrun025 Approved by CLC proposal #234: https://github.com/haskell/core-libraries-committee/issues/234 (cherry picked from commit 2eca52b4) (cherry picked from commit 288692dd)
-
Cheng Shao authored
(cherry picked from commit af771148) (cherry picked from commit 84c875d1)
-
Cheng Shao authored
The wasm backend didn't properly make use of all Cmm global registers due to #24347. Now that it is fixed, this patch re-enables full register mapping for wasm32, and we can now generate smaller & faster wasm modules that doesn't always spill arguments onto the stack. Fixes #22460 #24152. (cherry picked from commit 0cda2b8b) (cherry picked from commit f1f5068b398b1effb837add38ecc5303dc9a381f) (cherry picked from commit 1e695750)
-
Cheng Shao authored
ghc-api tests for wasm32 are more likely to timeout due to the large wasm module sizes, especially when testing with wasm native tail calls, given wasmtime's handling of tail call opcodes are suboptimal at the moment. It makes sense to increase timeout specifically for these tests on wasm32. This doesn't affect other targets, and for wasm32 we don't increase timeout for all tests, so not to risk letting major performance regressions slip through the testsuite. (cherry picked from commit 07ab5cc1) (cherry picked from commit c4d1edb1)
-
Cheng Shao authored
This patch includes all wasm32-specific testsuite fixes. (cherry picked from commit bd2bfdec)
-
req_cmm is more informative than js_skip (cherry picked from commit 239202a2)
-
Cheng Shao authored
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). (cherry picked from commit b174a110)
-
Cheng Shao authored
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. (cherry picked from commit cb933665)
-
Cheng Shao authored
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. (cherry picked from commit aa6afe8a)
-
See #22630 and !9552 This commit: - splits req_smp into req_target_smp and req_ghc_smp - changes the testsuite driver to calculate req_ghc_smp - changes a handful of tests to use req_target_smp instead of req_smp - changes a handful of tests to use req_host_smp when needed The problem: - the problem this solves is the ambiguity surrounding req_smp - on master req_smp was used to express the constraint that the program being compiled supports smp _and_ that the host RTS (i.e., the RTS used to compile the program) supported smp. Normally that is fine, but in cross compilation this is not always the case as was discovered in #22630. The solution: - Differentiate the two constraints: - use req_target_smp to say the RTS the compiled program is linked with (and the platform) supports smp - use req_host_smp to say the RTS the host is linked with supports smp WIP: fix req_smp (target vs ghc) add flag to separate bootstrapper split req_smp -> req_target_smp and req_ghc_smp update tests smp flags cleanup and add some docstrings only set ghc_with_smp to bootstrapper on S1 or CC Only set ghc_with_smp to bootstrapperWithSMP of when testing stage 1 and cross compiling test the RTS in config/ghc not hadrian re-add ghc_with_smp fix and align req names fix T11760 to use req_host_smp test the rts directly, avoid python 3.5 limitation test the compiler in a try block align out of tree and in tree withSMP flags mark failing tests as host req smp testsuite: req_host_smp --> req_ghc_smp Fix ghc vs host, fix ghc_with_smp leftover (cherry picked from commit 06036d93)
-
- Jan 20, 2025
-
-
Luite Stegeman authored
- Jan 16, 2025
-
-
Luite Stegeman authored
We found that speculative evaluation can increase the amount of allocations in some circumstances. This patch adds new flags for selectively disabling speculative evaluation, allowing us to test the effect of the optimization. The new flags are: -fspec-eval globally enable speculative evaluation -fspec-eval-dictfun enable speculative evaluation for dictionary functions (no effect if speculative evaluation is globally disabled) The new flags are on by default for all optimisation levels. See #25284 (cherry picked from commit 23099752)
-
With a recent LLVM, `llc -version` emits the version on the first line if the vendor is set. It emits the version on the second line otherwise. Therefore, we need to check the both lines to detect the version. GHC now emits a warning if it fails to detect the LLVM version, so we can notice if the output of `llc -version` changes in the future. Also, the warning for using LLVM < 10 on s390x is removed, because we assume LLVM >= 13 now. This fixes the definition of __GLASGOW_HASKELL_LLVM__ macro. Fixes #25606 (cherry picked from commit a928c326)
-
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 MultiLayerModulesTH_Make T21839r mhu-perf Metric Decrease: MultiLayerModulesTH_Make (cherry picked from commit 9edcb1fb)
-
(cherry picked from commit 683115a4)
-
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 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)
-
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)
-
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)
-
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)
-