Use full equality for CSE
authorsimonpj@microsoft.com <unknown>
Fri, 11 Dec 2009 17:39:20 +0000 (17:39 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 11 Dec 2009 17:39:20 +0000 (17:39 +0000)
commit21eeb926c8bf398e38919429d2375b78be45b14b
tree712223f9a93b5f0093417a2a20b09e077839b16a
parenta33b1cd8490faf8a3b6bdc163555c3f986048231
Use full equality for CSE

In CSE we were getting lots of apprarently-unequal expressions with
the same hash code.  In fact they were perfectly equal -- but we were
using a cheap-and-cheerful equality tests for CoreExpr that said False
for any lambda expression!

This patch adds a proper equality test for Core, with alpha-renaming.
It's easy to do, and will avoid silly cases of CSE failing to fire.

We should get less of this:
  WARNING: file compiler/simplCore/CSE.lhs line 326
  extendCSEnv: long list, length 18
from a compiler built with -DDEBUG
compiler/coreSyn/CoreUtils.lhs
compiler/simplCore/CSE.lhs
compiler/types/Coercion.lhs
compiler/types/Type.lhs