[Git][ghc/ghc][wip/az/exactprint-annotation-rationalisation] 21 commits: CorePrep: Don't speculatively evaluate bindings that we have already discovered to be absent
Alan Zimmerman pushed to branch wip/az/exactprint-annotation-rationalisation at Glasgow Haskell Compiler / GHC Commits: 9b714c4c by Zubin Duggal at 2026-07-05T09:40:36+05:30 CorePrep: Don't speculatively evaluate bindings that we have already discovered to be absent In #25924, we segfault because speculation forces a projection out of a RUBBISH dictionary (which we generated because it absent). Solution: Don't speculate on bindings we already know are absent. Fixes 25924 - - - - - 4a59b3ee by Zubin Duggal at 2026-07-05T09:40:36+05:30 Don't make absent fillers for terminating types In #25924 we discovered that we could speculatively evaluate an absent filler for a dictionary, and project a field (a superclass selector) out of it, resulting in segfaults. Solution: Never make an absent filler or rubbish literal for a terminating type like a dictionary. mkAbsentFiller returns Nothing for isTerminatingType, so worker/wrapper and the specialiser keep the real argument instead. Some small metric decreases because we do a little less work in the simplifier now. Metric Decrease: T9872a T9872b T9872c TcPlugin_RewritePerf - - - - - 383ddcd4 by Alan Zimmerman at 2026-07-06T07:08:16-04:00 EPA: Move the 'where' annotation for PatSynBind This allows us to move it out of the MatchGroup exact print annotation too - - - - - 26388a3e by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Replace AnnListItem with simply [TrailingAnn] Remove the unnecessary wrapper around a single field. - - - - - c54c3ba0 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Keep binds and sigs together in HsValBindsLR This allows us to get rid of AnnSortKey BindTag - - - - - 36263258 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 Keep decls together in ClassDecl Keep binds and sigs together in HsValBindsLR TBD - - - - - ace92759 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 Fix ppr for ClassDecl to include DocDs - - - - - 87aecdab by Alan Zimmerman at 2026-07-06T18:18:24+01:00 Some tidy ups of the decls stuff. Squash it in - - - - - 1f13b166 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: ClsInstDecl as list in GhcPs - - - - - 4f85203e by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove LocatedP from OverlapMode - - - - - cc2b2518 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove LocatedP from CType - - - - - f815e482 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove LocatedP, last use in WarningTxt - - - - - 2e0eaf53 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove LocatedE from WarningCategory - - - - - 14b7ba38 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove LocateE from XCImport and XCExport - - - - - f6213b84 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove LocatedE from HsRecFields dot - - - - - 7f912c61 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove LocatedE completely, last usage for pats - - - - - d0b1d9de by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove AnnList (EpToken "where") usages This is moving toward removing the parameter from AnnList completely - - - - - be1eb4d4 by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA remove AnnList (EpToken "rec") usages - - - - - 5537e90d by Alan Zimmerman at 2026-07-06T18:18:24+01:00 EPA: Remove last parameterised AnnList usage (EpaLocation) Also remove the parameter - - - - - 2606a98a by Alan Zimmerman at 2026-07-06T18:18:24+01:00 TTG: Add extension points to BooleanFormula They are currently unused, but will be used for exact print annotations next - - - - - 0d4d8f86 by Alan Zimmerman at 2026-07-06T22:03:31+01:00 EPA: Remove LocatedBC / SrcSpanBF - - - - - 104 changed files: - + changelog.d/fix-absent-dict-projection - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Core/Class.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Data/BooleanFormula.hs - compiler/GHC/Hs/Binds.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Decls/Overlap.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/Hs/Stats.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Iface/Warnings.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Tc/Deriv.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Class.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Instantiate.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/ForeignCall.hs - compiler/GHC/Types/Literal.hs - compiler/GHC/Unit/Module/Warnings.hs - compiler/Language/Haskell/Syntax/Binds.hs - compiler/Language/Haskell/Syntax/BooleanFormula.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/Language/Haskell/Syntax/Extension.hs - ghc/GHCi/UI.hs - + hadrian/cfg/system.config.host - + hadrian/cfg/system.config.target - + testsuite/tests/core-to-stg/T25924/B.hs - + testsuite/tests/core-to-stg/T25924/Main.hs - + testsuite/tests/core-to-stg/T25924/all.T - + testsuite/tests/core-to-stg/T25924a.hs - + testsuite/tests/core-to-stg/T25924a.stdout - testsuite/tests/core-to-stg/all.T - testsuite/tests/dmdanal/should_compile/T18982.stderr - testsuite/tests/ghc-api/T25121_status.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/Test20239.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/haddock/haddock_examples/haddock.Test.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T14189.stderr - testsuite/tests/parser/should_compile/T15279.stderr - testsuite/tests/parser/should_compile/T15323.stderr - testsuite/tests/parser/should_compile/T20452.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20718b.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/parser/should_compile/T23315/T23315.stderr - testsuite/tests/printer/AnnotationNoListTuplePuns.stdout - testsuite/tests/printer/T18791.stderr - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - testsuite/tests/simplCore/should_compile/T26615.stderr - testsuite/tests/typecheck/should_compile/T15242.stderr - testsuite/tests/typecheck/should_compile/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs - utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs - utils/haddock/haddock-api/src/Haddock/Convert.hs - utils/haddock/haddock-api/src/Haddock/GhcUtils.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs - utils/haddock/haddock-api/src/Haddock/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d13d46c52095deb2635aa173b80d2a... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d13d46c52095deb2635aa173b80d2a... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Alan Zimmerman (@alanz)