Simon Peyton Jones pushed to branch wip/spj-try-opt-coercion at Glasgow Haskell Compiler / GHC
Commits:
-
d2e98e01
by Simon Peyton Jones at 2026-01-19T15:25:26+00:00
2 changed files:
Changes:
| ... | ... | @@ -265,6 +265,17 @@ the desugarer and includes the simplifier, worker-wrapper transformation, the |
| 265 | 265 | rule engine, the specialiser, the strictness/occurrence analyser, and a common
|
| 266 | 266 | subexpression elimination pass.
|
| 267 | 267 | |
| 268 | +.. ghc-flag:: -dcheck-opt-co
|
|
| 269 | + :shortdesc: Add consistency checks to the coercion optimisiers
|
|
| 270 | + shorter
|
|
| 271 | + :type: dynamic
|
|
| 272 | + |
|
| 273 | + Affects both :ghc-flag:`-fopt-coercion` and :ghc-flag:`-fopt-refl-coercion`.
|
|
| 274 | + Adds compile-time checks that these coercion optimisers don't change types;
|
|
| 275 | + and adds a trace message if they succeeds in shrinking (or expanding) the
|
|
| 276 | + coercion. If you add :ghc-flag:`-dppr-debug` you can see the shrunk/expanded
|
|
| 277 | + coercion itself.
|
|
| 278 | + |
|
| 268 | 279 | .. ghc-flag:: -ddump-call-arity
|
| 269 | 280 | :shortdesc: Dump output of the call arity analysis pass.
|
| 270 | 281 | :type: dynamic
|
| ... | ... | @@ -1004,7 +1004,18 @@ as such you shouldn't need to set any of them explicitly. A flag |
| 1004 | 1004 | |
| 1005 | 1005 | :default: on
|
| 1006 | 1006 | |
| 1007 | - Turn on the coercion optimiser.
|
|
| 1007 | + Turn on the "big hammer" coercion optimiser.
|
|
| 1008 | + |
|
| 1009 | +.. ghc-flag:: -fopt-refl-coercion
|
|
| 1010 | + :shortdesc: Turn on the lightweight coercion optimiser
|
|
| 1011 | + :type: dynamic
|
|
| 1012 | + :reverse: -fno-opt-refl-coercion
|
|
| 1013 | + :category:
|
|
| 1014 | + |
|
| 1015 | + :default: on
|
|
| 1016 | + |
|
| 1017 | + Turn on the "lightweight" coercion optimiser, which just looks for
|
|
| 1018 | + reflexivity within sequences of coercions.
|
|
| 1008 | 1019 | |
| 1009 | 1020 | .. ghc-flag:: -fno-pre-inlining
|
| 1010 | 1021 | :shortdesc: Turn off pre-inlining
|