Don't build unnecessary lets in knownCon
authorsimonpj@microsoft.com <unknown>
Wed, 16 Aug 2006 10:48:31 +0000 (10:48 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 16 Aug 2006 10:48:31 +0000 (10:48 +0000)
commiteba4dfc2e9cf3caae2cdb6e54558972745a121f7
tree4bfaa1f9d92bb5b3cdec0e05226cbe46e96a357c
parent088962101d8ad4ba5455e295258df009c72315f2
Don't build unnecessary lets in knownCon

Faced with
case x of y { (a,b) -> rhs }

where x is bound to (c,d), we were generating

let y = (c,d) in rhs

and thenn hoping to get rid of the y binding by CSE or some such.  It's
better simply not to build it in the first place, by generating

let y = x in rhs

This patch does the job.
compiler/simplCore/Simplify.lhs