patch applied (ghc): Eliminate case-of-cast

Simon Peyton Jones simonpj at microsoft.com
Wed Oct 4 08:17:51 EDT 2006


Wed Oct  4 04:07:41 PDT 2006  simonpj at microsoft.com
  * 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.
  

    M ./compiler/simplCore/Simplify.lhs -21 +42


More information about the Cvs-ghc mailing list