#6111: Simple loop performance regression of 7.4.1 relative to 7.0.4
--------------------------------------------+-------------------------------
    Reporter:  mdgabriel                    |       Owner:  igloo               
   
        Type:  bug                          |      Status:  new                 
   
    Priority:  normal                       |   Milestone:                      
   
   Component:  Compiler                     |     Version:  7.4.1               
   
    Keywords:  Loop performance regression  |          Os:  Linux               
   
Architecture:  x86                          |     Failure:  Runtime performance 
bug
  Difficulty:  Unknown                      |    Testcase:                      
   
   Blockedby:                               |    Blocking:                      
   
     Related:  #6110                        |  
--------------------------------------------+-------------------------------
Changes (by simonpj):

  * owner:  => igloo
  * difficulty:  => Unknown


Comment:

 Seee also #6110

 Ian,

 The reason for this regression is, I believe, that before we generated:
 {{{
             Main.$w$sloop
               (GHC.Prim.+# wild1_aPr 1)
               ww1_s1U0
               (GHC.Prim.+## ww2_s1U4 (GHC.Prim.int2Double# wild1_aPr));
 }}}
 but now we generate:
 {{{
             case GHC.Integer.Type.doubleFromInteger
                    (GHC.Integer.Type.smallInteger wild1_aUP)
             of wild2_aUZ { __DEFAULT ->
             Main.$w$sloop
               (GHC.Prim.+# wild1_aUP 1)
               ww1_s2kW
               (GHC.Prim.+## ww2_s2l0 wild2_aUZ)
 }}}
 So the problem is that we don't have a rule
 {{{
         doubleFromInteger (smallInteger x) = int2Double# x
 }}}
 The thing is that this isn't an isolated occurrence. Pretty much every
 function that pattern matches on `(S# x)` should have a smallInteger rule
 instead. But there are practically no RULES in `GHC.Integer.Type` in
 `integer-gmp`.

 There ''are'' a bunch of `builtinInteger` rules in `PrelRules`. But
 nothing for this case.  And no comments to explain why they are there.

 There is a [wiki:Commentary/Libraries/Integer integer library wiki page]
 but it does not explain
  * Why lots of things are `NOINLINE`
  * Why the rules are in `PrelRules` (to avoid duplication??)
 Generally, explaining the thinking would be good.

 Could you look at this and, I suppose, add lots of rules?

 Many thanks.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to