Andreas Klebinger pushed to branch wip/andreask/occ_anal_tuning at Glasgow Haskell Compiler / GHC Commits: 1275d360 by Matthew Pickering at 2025-10-03T06:05:56-04:00 testsuite: Use ghci_ways to set ways in PackedDataCon/UnboxedTuples/UnliftedDataTypeInterp tests These tests reimplemented the logic from `valid_way` in order to determine what ways to run. It's easier to use this combination of `only_ways` and `extra_ways` to only run in GHCi ways and always run in GHCi ways. - - - - - c06b534b by Matthew Pickering at 2025-10-03T06:06:40-04:00 Rename interpreterBackend to bytecodeBackend This is preparation for creating bytecode files. The "interpreter" is one way in which we can run bytecode objects. It is more accurate to describe that the backend produces bytecode, rather than the means by which the code will eventually run. The "interpreterBackend" binding is left as a deprecated alias. - - - - - 41bdb16f by Andreas Klebinger at 2025-10-06T18:04:34-04:00 Add a perf test for #26425 - - - - - 1da0c700 by Andreas Klebinger at 2025-10-06T18:05:14-04:00 Testsuite: Silence warnings about Wx-partial in concprog001 - - - - - 7471eb6a by sheaf at 2025-10-07T21:39:43-04:00 Improve how we detect user type errors in types This commit cleans up all the code responsible for detecting whether a type contains "TypeError msg" applications nested inside it. All the logic is now in 'userTypeError_maybe', which is always deep. Whether it looks inside type family applications is determined by the passed-in boolean flag: - When deciding whether a constraint is definitely insoluble, don't look inside type family applications, as they may still reduce -- in which case the TypeError could disappear. - When reporting unsolved constraints, look inside type family applications: they had the chance to reduce but didn't, and the custom type error might contain valuable information. All the details are explained in Note [Custom type errors in constraints] in GHC.Tc.Types.Constraint. Another benefit of this change is that it allows us to get rid of the deeply dodgy 'getUserTypeErrorMsg' function. This commit also improves the detection of custom type errors, for example in equality constraints: TypeError blah ~# rhs It used to be the case that we didn't detect the TypeError on the LHS, because we never considered that equality constraints could be insoluble due to the presence of custom type errors. Addressing this oversight improves detection of redundant pattern match warnings, fixing #26400. - - - - - 29955267 by Rodrigo Mesquita at 2025-10-07T21:40:25-04:00 cleanup: Drop obsolete settings from config.mk.in These values used to be spliced into the bindist's `config.mk` s.t. when `make` was run, the values were read and written into the bindist installation `settings` file. However, we now carry these values to the bindist directly in the default.target toolchain file, and `make` writes almost nothing to `settings` now (see #26227) The entries deleted in this MR were already unused. Fixes #26478 - - - - - f7adfed2 by ARATA Mizuki at 2025-10-08T08:37:24-04:00 T22033 is only relevant if the word size is 64-bit Fixes #25497 - - - - - ff1650c9 by Ben Gamari at 2025-10-08T08:38:07-04:00 rts/posix: Enforce iteration limit on heap reservation logic Previously we could loop indefinitely when attempting to get an address space reservation for our heap. Limit the logic to 8 iterations to ensure we instead issue a reasonable error message. Addresses #26151. - - - - - 01844557 by Ben Gamari at 2025-10-08T08:38:07-04:00 rts/posix: Hold on to low reservations when reserving heap Previously when the OS gave us an address space reservation in low memory we would immediately release it and try again. However, on some platforms this meant that we would get the same allocation again in the next iteration (since mmap's `hint` argument is just that, a hint). Instead we now hold on to low reservations until we have found a suitable heap reservation. Fixes #26151. - - - - - b2c8d052 by Sven Tennie at 2025-10-08T08:38:47-04:00 Build terminfo only in upper stages in cross-builds (#26288) Currently, there's no way to provide library paths for [n]curses for both - build and target - in cross-builds. As stage0 is only used to build upper stages, it should be fine to build terminfo only for them. This re-enables building cross-compilers with terminfo. - - - - - c58f9a61 by Julian Ospald at 2025-10-08T08:39:36-04:00 ghc-toolchain: Drop `ld.gold` from merge object command It's deprecated. Also see #25716 - - - - - 2b8baada by sheaf at 2025-10-08T18:23:37-04:00 Improvements to 'mayLookIdentical' This commit makes significant improvements to the machinery that decides when we should pretty-print the "invisible bits" of a type, such as: - kind applications, e.g. '@k' in 'Proxy @k ty' - RuntimeReps, e.g. 'TYPE r' - multiplicities and linear arrows 'a %1 -> b' To do this, this commit refactors 'mayLookIdentical' to return **which** of the invisible bits don't match up, e.g. in (a %1 -> b) ~ (a %Many -> b) we find that the invisible bit that doesn't match up is a multiplicity, so we should set 'sdocLinearTypes = True' when pretty-printing, and with e.g. Proxy @k1 ~ Proxy @k2 we find that the invisible bit that doesn't match up is an invisible TyCon argument, so we set 'sdocPrintExplicitKinds = True'. We leverage these changes to remove the ad-hoc treatment of linearity of data constructors with 'dataConDisplayType' and 'dataConNonLinearType'. This is now handled by the machinery of 'pprWithInvisibleBits'. Fixes #26335 #26340 - - - - - 129ce32d by sheaf at 2025-10-08T18:23:37-04:00 Store SDoc context in SourceError This commits modifies the SourceError datatype which is used for throwing and then reporting exceptions by storing all the info we need to be able to print the SDoc, including whether we should print with explicit kinds, explicit runtime-reps, etc. This is done using the new datatype: data SourceErrorContext = SEC !DiagOpts !(DiagnosticOpts GhcMessage) Now, when we come to report an error (by handling the exception), we have access to the full context we need. Fixes #26387 - - - - - f9790ca8 by Ben Gamari at 2025-10-08T18:24:19-04:00 gitlab-ci: Make RELEASE_JOB an input Rather than an undocumented variable. - - - - - 8e2e19a7 by Andreas Klebinger at 2025-10-10T16:12:04+02:00 OccAnal: Be stricter. * When combining usageDetails. * When constructing core expressions. In combineUsageDetails when combining the underlying adds we compute a new `LocalOcc` for each entry by combining the two existing ones. Rather than wait for those entries to be forced down the road we now force them immediately. Speeding up T26425 by about 10% with little effect on the common case. We also force CoreExprs we construct in order to prevent them from captuing the OccAnal Env massively reducing residency in some cases. For T26425 residency went down by a factor of ~10x. ------------------------- Metric Decrease: T26425 ------------------------- - - - - - 115 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC.hs - compiler/GHC/Core/Multiplicity.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Predicate.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Ppr.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Data/Graph/UnVar.hs - compiler/GHC/Driver/Backend.hs - compiler/GHC/Driver/Backend/Internal.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/Env/Types.hs - compiler/GHC/Driver/Errors.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Monad.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Iface/Decl.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Type.hs - compiler/GHC/Parser/Header.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Solver.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Types/CtLoc.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Tc/Utils/Unify.hs-boot - compiler/GHC/Tc/Validity.hs - compiler/GHC/Types/SourceError.hs - compiler/GHC/Types/TyThing/Ppr.hs - compiler/GHC/Types/Unique/FM.hs - compiler/GHC/Types/Var/Env.hs - compiler/GHC/Utils/Error.hs - compiler/GHC/Utils/Outputable.hs - docs/users_guide/extending_ghc.rst - ghc/GHCi/UI.hs - ghc/Main.hs - hadrian/bindist/config.mk.in - hadrian/src/Settings/Default.hs - rts/posix/OSMem.c - testsuite/driver/testglobals.py - testsuite/driver/testlib.py - testsuite/tests/concurrent/prog001/all.T - testsuite/tests/cpranal/should_compile/T18174.stderr - testsuite/tests/driver/T11429c.stderr - testsuite/tests/driver/T21682.stderr - testsuite/tests/driver/T5313.hs - testsuite/tests/ghc-api/T10052/T10052.hs - testsuite/tests/ghc-api/T10942.hs - testsuite/tests/ghc-api/T8639_api.hs - testsuite/tests/ghc-api/annotations-literals/literals.hs - testsuite/tests/ghc-api/apirecomp001/myghc.hs - testsuite/tests/ghci-wasm/T26431.hs - testsuite/tests/ghci/linking/dyn/T3372.hs - testsuite/tests/ghci/should_run/PackedDataCon/packeddatacon.T - testsuite/tests/ghci/should_run/UnboxedTuples/unboxedtuples.T - testsuite/tests/ghci/should_run/UnliftedDataTypeInterp/unlifteddatatypeinterp.T - testsuite/tests/indexed-types/should_fail/T14887.stderr - testsuite/tests/linear/should_fail/T19361.stderr - testsuite/tests/llvm/should_run/all.T - + testsuite/tests/perf/compiler/T26425.hs - testsuite/tests/perf/compiler/all.T - + testsuite/tests/pmcheck/should_compile/T26400.hs - + testsuite/tests/pmcheck/should_compile/T26400.stderr - + testsuite/tests/pmcheck/should_compile/T26400b.hs - testsuite/tests/pmcheck/should_compile/all.T - testsuite/tests/roles/should_compile/Roles13.stderr - testsuite/tests/simplCore/should_compile/OpaqueNoCastWW.stderr - testsuite/tests/simplCore/should_compile/T17673.stderr - testsuite/tests/simplCore/should_compile/T18078.stderr - testsuite/tests/simplCore/should_compile/T18995.stderr - testsuite/tests/simplCore/should_compile/T19890.stderr - testsuite/tests/simplCore/should_compile/T21948.stderr - testsuite/tests/simplCore/should_compile/T21960.stderr - testsuite/tests/simplCore/should_compile/T24808.stderr - − testsuite/tests/simplCore/should_compile/T25713.stderr - testsuite/tests/simplCore/should_compile/T4201.stdout - testsuite/tests/simplCore/should_compile/T8331.stderr - testsuite/tests/typecheck/no_skolem_info/T20232.stderr - testsuite/tests/typecheck/should_fail/T11672.stderr - testsuite/tests/typecheck/should_fail/T12373.stderr - testsuite/tests/typecheck/should_fail/T15807.stderr - testsuite/tests/typecheck/should_fail/T16074.stderr - testsuite/tests/typecheck/should_fail/T18357a.stderr - testsuite/tests/typecheck/should_fail/T19627.stderr - testsuite/tests/typecheck/should_fail/T20241b.stderr - testsuite/tests/typecheck/should_fail/T21530a.stderr - testsuite/tests/typecheck/should_fail/UnliftedNewtypesFamilyKindFail2.stderr - testsuite/tests/typecheck/should_fail/VisFlag1.stderr - utils/check-exact/Parsers.hs - utils/check-exact/Preprocess.hs - utils/ghc-toolchain/src/GHC/Toolchain/Tools/MergeObjs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f2d549ece632573d1e36ee2c9b9725... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f2d549ece632573d1e36ee2c9b9725... You're receiving this email because of your account on gitlab.haskell.org.