[GHC] #4065: Inconsistent loop performance

GHC cvs-ghc at haskell.org
Fri May 14 04:30:56 EDT 2010


#4065: Inconsistent loop performance
---------------------------------+------------------------------------------
    Reporter:  rl                |        Owner:                         
        Type:  bug               |       Status:  new                    
    Priority:  normal            |    Milestone:  6.14.1                 
   Component:  Compiler          |      Version:  6.13                   
    Keywords:                    |   Difficulty:                         
          Os:  Unknown/Multiple  |     Testcase:                         
Architecture:  Unknown/Multiple  |      Failure:  Runtime performance bug
---------------------------------+------------------------------------------
Changes (by simonmar):

  * milestone:  => 6.14.1


Comment:

 The problem is this:

 {{{
 Test.$wbar_entry()
         { []
         }
     cmr:
         _slB::I64 = R2;
         if (_slB::I64 != 0) goto cmv;
         R1 = R3;
         jump (I64[I64[Sp]]) ();
     cmv:
         R2 = _slB::I64 - 1;
         R3 = R3 + 1;
         jump Test.$wbar_entry ();
 }
 }}}

 The assignment of `_slB` should really be inlined (or forward-propagated,
 if you like).  The current code generator isn't clever enough to do this
 transformation when the use of the variable is in a different basic block
 from its assignment, and it's not an easy extension to make.  This very
 example appears in a comment in `CmmOpt.hs`, in fact.

 The new code generator will be able to do this using the dataflow
 framework.  I'm sure LLVM will do it too (and more).  We can leave the
 ticket open on the 6.14 branch to make sure the new backend fixes it.

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


More information about the Glasgow-haskell-bugs mailing list