#701: Better CSE optimisation
---------------------------------+------------------------------------------
    Reporter:  simonmar          |        Owner:  michalt             
        Type:  task              |       Status:  new                 
    Priority:  normal            |    Milestone:  _|_                 
   Component:  Compiler          |      Version:  6.4.1               
    Keywords:                    |     Testcase:  N/A                 
   Blockedby:                    |   Difficulty:  Difficult (2-5 days)
          Os:  Unknown/Multiple  |     Blocking:                      
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown        
---------------------------------+------------------------------------------
Changes (by michalt):

  * owner:  => michalt


Comment:

 Interesting ticket. :)

 > One possible way forward is to have a separate CSE pass that transformed
 > expressions containing common subexpressions into the let-form above,
 and let
 > the existing CSE pass do the final replacement.

 But how to identify those subexpressions that are common? Wouldn't that
 need
 another pass? I was thinking about sligthly modifying the idea: have one
 pass to
 identify common subexpressions and then a second one that is an improved
 version
 of current CSE, i.e. uses the information about what subexpressions could
 be
 shared to split more complex expressions and also does the elimination
 along the
 way. Like
 {{{
   let x = e1 + e2
       y = e1 + e3
 }}}
 So `e1` would be identified as a common subexpression and then so we would
 transfor the above to:
 {{{
   let z = e1
       x = z + e2
       y = z + e3
 }}}
 What do you think?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/701#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to