[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: Improve pretty printer for HsExpr
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: e7df6cc0 by Simon Peyton Jones at 2025-09-23T14:34:39-04:00 Improve pretty printer for HsExpr Given a very deeply-nested application, it just kept printing deeper and deeper. This small change makes it cut off. Test is in #26330, but we also get a dramatic decrease in compile time for perf/compiler/InstanceMatching: InstanceMatching 4,086,884,584 1,181,767,232 -71.1% GOOD Why? Because before we got a GIGANTIC error message that took ages to pretty-print; now we get this much more civilised message (I have removed some whitespace.) Match.hs:1007:1: error: • No instance for ‘Show (F001 a)’ arising from a use of ‘showsPrec’ • In the second argument of ‘showString’, namely ‘(showsPrec 11 b1 (GHC.Internal.Show.showSpace (showsPrec 11 b2 (GHC.Internal.Show.showSpace (showsPrec 11 b3 (GHC.Internal.Show.showSpace (showsPrec 11 b4 (GHC.Internal.Show.showSpace (showsPrec 11 b5 (GHC.Internal.Show.showSpace (showsPrec 11 b6 (GHC.Internal.Show.showSpace (showsPrec ...)))))))))))))’ ----------------------- The main payload is * At the start of `pprExpr` * In the defn of `pprApp` A little bit of refactoring: * It turned out that we were setting the default cut-off depth to a fixed value in two places, so changing one didn't change the other. See defaultSDocDepth and defaultSDocCols * I refactored `pprDeeperList` a bit so I could understand it better. Because the depth calculation has changed, there are lots of small error message wibbles. Metric Decrease: InstanceMatching - - - - - 209f0158 by Simon Peyton Jones at 2025-09-23T14:34:39-04:00 Use Outputable.ellipsis rather than text "..." - - - - - 64bb0e37 by Sylvain Henry at 2025-09-23T14:35:56-04:00 deriveConstants: automatically pass -fcommon CC flag (#26393) By mistake we tried to use deriveConstants without passing `--gcc-flag -fcommon` (which Hadrian does) and it failed. This patch: 1. adds parsing support for constants stored in the .bss section (i.e. when -fcommon isn't passed) 2. enables passing `-fcommon` automatically to the C compiler because Windows requires this for subtle reasons 3. Documents the subtle reasons (1) isn't strictly necessary because we always do (2) but it does no harm and it is still useful if the CC flags ever contain -fno-common - - - - - afcdf92f by Oleg Grenrus at 2025-09-23T14:36:41-04:00 Don't wrap spaces in <span>s Doing similar comparison as in 63189b2ceca07edf4e179f4180ca60d470c62cb3 With this change the gzipped documentation is now 2% smaller (previously 1%) 12_694_206 Agda-2.9.0-docs-orig.tar.gz 12_436_829 Agda-2.9.0-docs.tar.gz Unzipped docs are 5% smaller (previously 3%) 178M Agda-2.9.0-docs-orig 169M Agda-2.9.0-docs Individual hyperlinked sources are around 7-10% smaller (previously 5%) (`Parser` module is generated by happy and has relatively little whitespace) 14_230_117 Agda.Syntax.Parser.Parser.html 13_220_758 Agda.Syntax.Parser.Parser.html Agda's hyperlinked sources are 9% smaller now: 121M Agda-2.9.0-docs-orig/src 110M Agda-2.9.0-docs/src - - - - - 67de53a6 by Cheng Shao at 2025-09-23T14:37:31-04:00 rts: remove obsolete __GNUC__ related logic This patch removes obsolete `__GNUC__` related logic, given on any currently supported platform and toolchain, `__GNUC__ >= 4` is universally true. Also pulls some other weeds and most notably, use `__builtin___clear_cache` for clang as well, since clang has supported this gcc intrinsic since 2014, see https://github.com/llvm/llvm-project/commit/c491a8d4577052bc6b3b4c72a7db6a7c.... - - - - - 39365c97 by Sven Tennie at 2025-09-23T15:10:07-04:00 RV64: Fix: Add missing truncation to MO_S_Shr (#26248) Sub-double word (<W64) registers need to be truncated after the operation. - - - - - 648eb2ec by Sven Tennie at 2025-09-23T15:10:07-04:00 RV64: Cleanup shift emitting cases/code Remove overlapping cases to make the shift logic easier to understand. - - - - - 1a4982bb by Alex Washburn at 2025-09-23T15:10:08-04:00 Correcting LLVM linking of Intel BMI intrinsics pdep{8,16} and pext{8,16}. This patch fixes #26065. The LLVM interface does not expose bindings to: - llvm.x86.bmi.pdep.8 - llvm.x86.bmi.pdep.16 - llvm.x86.bmi.pext.8 - llvm.x86.bmi.pext.16 So calls are instead made to llvm.x86.bmi.{pdep,pext}.32 in these cases, with pre/post-operation truncation to constrain the logical value range. - - - - - 19257e0d by Peng Fan at 2025-09-23T15:10:22-04:00 NCG/LA64: Implement MO_BSwap and MO_BRev with bit-manipulation Instructions - - - - - 05cdcc1e by Sylvain Henry at 2025-09-23T15:10:31-04:00 Allow Core plugins to access unoptimized Core (#23337) Make the first simple optimization pass after desugaring a real CoreToDo pass. This allows CorePlugins to decide whether they want to be executed before or after this pass. - - - - - 03e71c3f by Simon Hengel at 2025-09-23T15:10:32-04:00 docs: Fix typo in scoped_type_variables.rst - - - - - 7668b4a8 by Cheng Shao at 2025-09-23T15:10:32-04:00 ghci: fix bootstrapping with 9.12.3-rc1 and above This patch fixes bootstrapping GHC with 9.12.3-rc1 and above. ghci defines `Binary` instance for `HalfWord` in `ghc-heap`, which is a proper `newtype` in 9.14 and starting from 9.12.3. Given we don't build `ghc-heap` in stage0, we need to fix this predicate so that it corresponds to the boot ghc versions that contain the right version of `ghc-heap`. - - - - - 96 changed files: - compiler/GHC/CmmToAsm/LA64/CodeGen.hs - compiler/GHC/CmmToAsm/LA64/Instr.hs - compiler/GHC/CmmToAsm/LA64/Ppr.hs - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Core/Opt/Pipeline.hs - compiler/GHC/Core/Opt/Pipeline/Types.hs - compiler/GHC/Core/Opt/Simplify/Env.hs - compiler/GHC/Core/Ppr.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Errors/Ppr.hs - compiler/GHC/HsToCore/Pmc/Ppr.hs - compiler/GHC/HsToCore/Pmc/Types.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/Runtime/Heap/Inspect.hs - compiler/GHC/Runtime/Loader.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Types/Hint/Ppr.hs - compiler/GHC/Utils/Outputable.hs - compiler/GHC/Utils/Ppr.hs - docs/users_guide/exts/scoped_type_variables.rst - hadrian/src/Settings/Builders/DeriveConstants.hs - libraries/ghc-internal/cbits/atomic.c - libraries/ghc-internal/cbits/ctz.c - libraries/ghci/GHCi/Message.hs - rts/RtsStartup.c - rts/RtsSymbols.c - rts/include/Rts.h - rts/include/Stg.h - rts/include/rts/Types.h - rts/sm/BlockAlloc.c - rts/sm/Evac.h - rts/sm/Storage.c - testsuite/tests/arrows/gadt/T17423.stderr - testsuite/tests/indexed-types/should_compile/PushedInAsGivens.stderr - testsuite/tests/indexed-types/should_fail/T26176.stderr - testsuite/tests/indexed-types/should_fail/T2693.stderr - testsuite/tests/indexed-types/should_fail/T4093b.stderr - testsuite/tests/indexed-types/should_fail/T8518.stderr - testsuite/tests/indexed-types/should_fail/T9662.stderr - testsuite/tests/linear/should_fail/Linear17.stderr - testsuite/tests/linear/should_fail/LinearLet7.stderr - + testsuite/tests/llvm/should_run/T26065.hs - + testsuite/tests/llvm/should_run/T26065.stdout - testsuite/tests/llvm/should_run/all.T - testsuite/tests/parser/should_fail/RecordDotSyntaxFail10.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail11.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail13.stderr - testsuite/tests/parser/should_fail/RecordDotSyntaxFail8.stderr - testsuite/tests/partial-sigs/should_compile/T21719.stderr - testsuite/tests/plugins/annotation-plugin/SayAnnNames.hs - testsuite/tests/plugins/late-plugin/LatePlugin.hs - testsuite/tests/plugins/simple-plugin/Simple/ReplacePlugin.hs - testsuite/tests/polykinds/T13393.stderr - testsuite/tests/rep-poly/T12709.stderr - testsuite/tests/simplCore/should_compile/simpl017.stderr - testsuite/tests/th/T10945.stderr - testsuite/tests/th/TH_StaticPointers02.stderr - testsuite/tests/typecheck/should_compile/T11339.stderr - testsuite/tests/typecheck/should_fail/DoExpansion3.stderr - testsuite/tests/typecheck/should_fail/T12177.stderr - testsuite/tests/typecheck/should_fail/T22707.stderr - testsuite/tests/typecheck/should_fail/T24064.stderr - + testsuite/tests/typecheck/should_fail/T26330.hs - + testsuite/tests/typecheck/should_fail/T26330.stderr - testsuite/tests/typecheck/should_fail/T8142.stderr - testsuite/tests/typecheck/should_fail/T8603.stderr - testsuite/tests/typecheck/should_fail/all.T - testsuite/tests/typecheck/should_fail/tcfail128.stderr - testsuite/tests/typecheck/should_fail/tcfail153.stderr - testsuite/tests/typecheck/should_fail/tcfail168.stderr - testsuite/tests/typecheck/should_fail/tcfail177.stderr - testsuite/tests/typecheck/should_fail/tcfail185.stderr - testsuite/tests/typecheck/should_run/Typeable1.stderr - utils/deriveConstants/Main.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs - utils/haddock/hypsrc-test/ref/src/Bug1091.html - utils/haddock/hypsrc-test/ref/src/CPP.html - utils/haddock/hypsrc-test/ref/src/Classes.html - utils/haddock/hypsrc-test/ref/src/Constructors.html - utils/haddock/hypsrc-test/ref/src/Identifiers.html - utils/haddock/hypsrc-test/ref/src/LinkingIdentifiers.html - utils/haddock/hypsrc-test/ref/src/Literals.html - utils/haddock/hypsrc-test/ref/src/Operators.html - utils/haddock/hypsrc-test/ref/src/Polymorphism.html - utils/haddock/hypsrc-test/ref/src/PositionPragmas.html - utils/haddock/hypsrc-test/ref/src/Quasiquoter.html - utils/haddock/hypsrc-test/ref/src/Records.html - utils/haddock/hypsrc-test/ref/src/TemplateHaskellQuasiquotes.html - utils/haddock/hypsrc-test/ref/src/TemplateHaskellSplices.html - utils/haddock/hypsrc-test/ref/src/Types.html - utils/haddock/hypsrc-test/ref/src/UsingQuasiquotes.html The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/401871c2a024fb42677f5048d60fa18... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/401871c2a024fb42677f5048d60fa18... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)