Make SpecConstr also check for GHC.Types.SPEC
SpecConstr has for a while now looked for types with the built
in ForceSpecConstr annotation, in order to know where to be particularly
aggressive.
Unfortunately using an annotation has a number of downsides, the most
prominent two being:
A) ForceSpecConstr is vital for efficiency (even if it's
a hack), but it means users of it must have GHCI - even though
stage2 features are not required for anything but the annotation.
B) Any user who might need it (read: vector) has to duplicate the same
piece of code. In general there are few people actually doing this,
but it's unclear why they should have to.
This patch makes SpecConstr look for functions applied to the new
GHC.Types.SPEC type - a copy of the already-extant 'SPEC' type - as well
as look for annotations, in the stage2 compiler.
In particular, this means `vector` can now be built with a stage1
compiler, since it no longer depends on stage2 for anything else. This
is particularly important for e.g. iOS cross-compilers.
This also means we should be able to build `vector` earlier in the build
process too, but this patch doesn't address that.
This requires an accompanying bump in ghc-prim.
Signed-off-by:
Austin Seipp <austin@well-typed.com>
Loading
Please register or sign in to comment