Thu Oct  5 06:24:37 PDT 2006  [EMAIL PROTECTED]
  * Float coercions out of lets
  
  Note [Float coercions]
  ~~~~~~~~~~~~~~~~~~~~~~
  When we find the binding
        x = e `cast` co
  we'd like to transform it to
        x' = e
        x = x `cast` co         -- A trivial binding
  There's a chance that e will be a constructor application or function, or 
something
  like that, so moving the coerion to the usage site may well cancel the 
coersions
  and lead to further optimisation.  Example:
  
       data family T a :: *
       data instance T Int = T Int
  
       foo :: Int -> Int -> Int
       foo m n = ...
          where
            x = T m
            go 0 = 0
            go n = case x of { T m -> go (n-m) }
                -- This case should optimise
  
  

    M ./compiler/simplCore/Simplify.lhs -3 +37
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to