Eliminate case-of-cast
authorsimonpj@microsoft.com <unknown>
Wed, 4 Oct 2006 11:07:41 +0000 (11:07 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 4 Oct 2006 11:07:41 +0000 (11:07 +0000)
commit0477b3897086e437d192db8d644b1ef30af82898
treee4eafd9077386b2bbdf2278719d888e3f2d0289a
parent08f6d46191ffd7a4e9f215aadcd253ba42bbda3e
Eliminate case-of-cast

Note [Case of cast]
~~~~~~~~~~~~~~~~~~~
Consider  case (v `cast` co) of x { I# ->
... (case (v `cast` co) of {...}) ...
We'd like to eliminate the inner case.  We can get this neatly by
arranging that inside the outer case we add the unfolding
v |-> x `cast` (sym co)
to v.  Then we should inline v at the inner case, cancel the casts,
and away we go

This patch does the job, fixing a performance hole reported by Roman.
compiler/simplCore/Simplify.lhs