diff options
author | sheaf <sam.derbyshire@gmail.com> | 2022-03-02 00:12:17 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-02 14:08:36 -0500 |
commit | b27b2af3fab48e21aabcc9441967c4dd7a6a75ea (patch) | |
tree | ca2919f3d98c35b6a22b08118ca32f4dae04a40d /testsuite/tests/perf | |
parent | aeea6bd588060108dea88996c19f48b9e50adad2 (diff) | |
download | haskell-b27b2af3fab48e21aabcc9441967c4dd7a6a75ea.tar.gz |
Introduce ConcreteTv metavariables
This patch introduces a new kind of metavariable, by adding the
constructor `ConcreteTv` to `MetaInfo`. A metavariable with
`ConcreteTv` `MetaInfo`, henceforth a concrete metavariable, can only
be unified with a type that is concrete (that is, a type that answers
`True` to `GHC.Core.Type.isConcrete`).
This solves the problem of dangling metavariables in `Concrete#`
constraints: instead of emitting `Concrete# ty`, which contains a
secret existential metavariable, we simply emit a primitive equality
constraint `ty ~# concrete_tv` where `concrete_tv` is a fresh concrete
metavariable.
This means we can avoid all the complexity of canonicalising
`Concrete#` constraints, as we can just re-use the existing machinery
for `~#`.
To finish things up, this patch then removes the `Concrete#` special
predicate, and instead introduces the special predicate `IsRefl#`
which enforces that a coercion is reflexive.
Such a constraint is needed because the canonicaliser is quite happy
to rewrite an equality constraint such as `ty ~# concrete_tv`, but
such a rewriting is not handled by the rest of the compiler currently,
as we need to make use of the resulting coercion, as outlined in the
FixedRuntimeRep plan.
The big upside of this approach (on top of simplifying the code)
is that we can now selectively implement PHASE 2 of FixedRuntimeRep,
by changing individual calls of `hasFixedRuntimeRep_MustBeRefl` to
`hasFixedRuntimeRep` and making use of the obtained coercion.
Diffstat (limited to 'testsuite/tests/perf')
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 6327b8cc0a..d7222696dd 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -167,7 +167,7 @@ test('T9872d', ['']) test ('T8095', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated',1) ], + collect_compiler_stats('bytes allocated',2) ], compile, ['-v0 -O']) test ('T13386', |