[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: Adjust and clarify handling of primop effects
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Fri Aug 4 21:54:43 UTC 2023
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
8ba20b21 by Matthew Craven at 2023-08-04T17:22:59-04:00
Adjust and clarify handling of primop effects
Fixes #17900; fixes #20195.
The existing "can_fail" and "has_side_effects" primop attributes
that previously governed this were used in inconsistent and
confusingly-documented ways, especially with regard to raising
exceptions. This patch replaces them with a single "effect"
attribute, which has four possible values: NoEffect, CanFail,
ThrowsException, and ReadWriteEffect. These are described in
Note [Classifying primop effects].
A substantial amount of related documentation has been re-drafted
for clarity and accuracy.
In the process of making this attribute format change for literally
every primop, several existing mis-classifications were detected and
corrected. One of these mis-classifications was tagToEnum#, which
is now considered CanFail; this particular fix is known to cause a
regression in performance for derived Enum instances. (See #23782.)
Fixing this is left as future work.
New primop attributes "cheap" and "work_free" were also added,
and used in the corresponding parts of GHC.Core.Utils.
In view of their actual meaning and uses, `primOpOkForSideEffects`
and `exprOkForSideEffects` have been renamed to `primOpOkToDiscard`
and `exprOkToDiscard`, respectively.
Metric Increase:
T21839c
- - - - -
41bf2c09 by sheaf at 2023-08-04T17:23:42-04:00
Update inert_solved_dicts for ImplicitParams
When adding an implicit parameter dictionary to the inert set, we must
make sure that it replaces any previous implicit parameter dictionaries
that overlap, in order to get the appropriate shadowing behaviour, as in
let ?x = 1 in let ?x = 2 in ?x
We were already doing this for inert_cans, but we weren't doing the same
thing for inert_solved_dicts, which lead to the bug reported in #23761.
The fix is thus to make sure that, when handling an implicit parameter
dictionary in updInertDicts, we update **both** inert_cans and
inert_solved_dicts to ensure a new implicit parameter dictionary
correctly shadows old ones.
Fixes #23761
- - - - -
a0f18ccf by Ben Gamari at 2023-08-04T17:54:34-04:00
Initial commit of Note [Thunks, blackholes, and indirections]
This Note attempts to summarize the treatment of thunks, thunk update,
and indirections.
This fell out of work on #23185.
- - - - -
a41df0e9 by sheaf at 2023-08-04T17:54:39-04:00
Remove zonk in tcVTA
This removes the zonk in GHC.Tc.Gen.App.tc_inst_forall_arg and its
accompanying Note [Visible type application zonk]. Indeed, this zonk
is no longer necessary, as we no longer maintain the invariant that
types are well-kinded without zonking; only that typeKind does not
crash; see Note [The Purely Kinded Type Invariant (PKTI)].
This commit removes this zonking step (as well as a secondary zonk),
and replaces the aforementioned Note with the explanatory
Note [Type application substitution], which justifies why the
substitution performed in tc_inst_forall_arg remains valid without
this zonking step.
Fixes #23661
- - - - -
641762b1 by Ben Gamari at 2023-08-04T17:54:39-04:00
Bump nofib submodule
Ensuring that nofib can be build using the same range of bootstrap
compilers as GHC itself.
- - - - -
27 changed files:
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Core.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/FloatIn.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Types/Demand.hs
- compiler/Setup.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Lint.hs
- hadrian/src/Settings/Builders/GenPrimopCode.hs
- libraries/base/Unsafe/Coerce.hs
- nofib
- rts/Updates.h
- + testsuite/tests/ghc-api/PrimOpEffect_Sanity.hs
- testsuite/tests/ghc-api/all.T
- + testsuite/tests/typecheck/should_run/T23761.hs
- + testsuite/tests/typecheck/should_run/T23761.stdout
- + testsuite/tests/typecheck/should_run/T23761b.hs
- + testsuite/tests/typecheck/should_run/T23761b.stdout
- testsuite/tests/typecheck/should_run/all.T
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e96417632de0fe48862f0077ebc570e8a5d822bd...641762b16dabbd35b26847560a47c88542dfd8b9
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e96417632de0fe48862f0077ebc570e8a5d822bd...641762b16dabbd35b26847560a47c88542dfd8b9
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230804/b30ed150/attachment.html>
More information about the ghc-commits
mailing list