Handle type-lets better
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 17 May 2017 08:44:46 +0000 (09:44 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 17 May 2017 08:47:21 +0000 (09:47 +0100)
commitd6461f9684f6f758320a5e5afbf0634fcc2996a5
tree746371a7a1dc34d12433e7e82a95ede213506a7b
parentd9e9a9b3016a05e6153de3803998877f91c6cdf4
Handle type-lets better

Core allows non-recursive type-lets, thus

   let a = TYPE ty in ...

They are substituted away very quickly, but it's convenient for
some passes to produce them (rather than to have to substitute
immediately).

Trac #13708 tried the effect of not running the simplifer at all
(a rather bizarre thing to do, but still).  That showed that some
passes crashed because they always treated a let-bounder binder
as an Id.  This patch adds some easy fixes.
compiler/basicTypes/Id.hs
compiler/basicTypes/Var.hs
compiler/coreSyn/CoreFVs.hs
compiler/simplCore/CSE.hs
compiler/simplCore/FloatIn.hs
testsuite/tests/simplCore/should_compile/T13708.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T