Refactor unfoldings
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 8 May 2014 10:21:16 +0000 (11:21 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 28 Aug 2014 10:14:05 +0000 (11:14 +0100)
commit6e0f6ededff6018a88dd390590a09f79842ccfa5
treec2d4f46cfdcf8b236d9ac751c48f0b0ccced7503
parente9cd1d5e9d6f0e019d6433a3c7dd9585b3f7ae6b
Refactor unfoldings

There are two main refactorings here

1.  Move the uf_arity field
       out of CoreUnfolding
       into UnfWhen
    It's a lot tidier there.  If I've got this right, no behaviour
    should change.

2.  Define specUnfolding and use it in DsBinds and Specialise
     a) commons-up some shared code
     b) makes sure that Specialise correctly specialises DFun
        unfoldings (which it didn't before)

The two got put together because both ended up interacting in the
specialiser.

They cause zero difference to nofib.
20 files changed:
compiler/coreSyn/CoreSubst.lhs
compiler/coreSyn/CoreSyn.lhs
compiler/coreSyn/CoreUnfold.lhs
compiler/coreSyn/PprCore.lhs
compiler/deSugar/DsBinds.lhs
compiler/iface/MkIface.lhs
compiler/iface/TcIface.lhs
compiler/simplCore/Simplify.lhs
compiler/specialise/Specialise.lhs
testsuite/tests/deSugar/should_compile/T2431.stderr
testsuite/tests/numeric/should_compile/T7116.stdout
testsuite/tests/simplCore/should_compile/T3717.stderr
testsuite/tests/simplCore/should_compile/T4908.stderr
testsuite/tests/simplCore/should_compile/T4930.stderr
testsuite/tests/simplCore/should_compile/T7360.stderr
testsuite/tests/simplCore/should_compile/T7785.stderr
testsuite/tests/simplCore/should_compile/T8848.stderr
testsuite/tests/simplCore/should_compile/all.T
testsuite/tests/simplCore/should_compile/spec-inline.stderr
testsuite/tests/simplCore/should_run/T2486.stderr