#4943: Another odd missed SpecConstr opportunity
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:                         
        Type:  bug               |       Status:  new                    
    Priority:  normal            |    Milestone:                         
   Component:  Compiler          |      Version:  7.1                    
    Keywords:                    |     Testcase:                         
   Blockedby:                    |   Difficulty:                         
          Os:  Unknown/Multiple  |     Blocking:                         
Architecture:  Unknown/Multiple  |      Failure:  Runtime performance bug
---------------------------------+------------------------------------------

Comment(by simonpj):

 Are you sure? Here's what I get with HEAD (`-O2 -ddump-simpl`).  Looks
 good, except for the awkward felicity of passing unused arguments around
 the loop (#4941):
 {{{
 Rec {
 $s$wa_r1Hy
   :: forall s_aIE.
      GHC.Types.Int
      -> GHC.Types.Int
      -> GHC.Types.Int
      -> GHC.Prim.MutableByteArray# s_aIE
      -> GHC.Prim.Int#
      -> GHC.Prim.Int#
      -> GHC.Prim.Int#
      -> GHC.Prim.State# s_aIE
      -> (# GHC.Prim.State# s_aIE, () #)
 [GblId, Arity=8, Caf=NoCafRefs, Str=DmdType LLLLLLLL]
 $s$wa_r1Hy =
   \ (@ s_aIE)
     (sc_s1Gq :: GHC.Types.Int)
     (sc1_s1Gr :: GHC.Types.Int)
     (sc2_s1Gs :: GHC.Types.Int)
     (sc3_s1Gt :: GHC.Prim.MutableByteArray# s_aIE)
     (sc4_s1Gu :: GHC.Prim.Int#)
     (sc5_s1Gv :: GHC.Prim.Int#)
     (sc6_s1Gw :: GHC.Prim.Int#)
     (sc7_s1Gx :: GHC.Prim.State# s_aIE) ->
     case GHC.Prim.># sc5_s1Gv sc6_s1Gw of _ {
       GHC.Types.False ->
         case GHC.Prim.readIntArray# @ s_aIE sc3_s1Gt sc5_s1Gv sc7_s1Gx
         of _ { (# s2#_aRI, e#_aRJ #) ->
         case GHC.Prim.writeIntArray#
                @ s_aIE sc3_s1Gt sc5_s1Gv (GHC.Prim.+# e#_aRJ sc4_s1Gu)
 s2#_aRI
         of s2#1_aS8 { __DEFAULT ->
         $s$wa_r1Hy
           @ s_aIE
           sc_s1Gq
           sc1_s1Gr
           sc2_s1Gs
           sc3_s1Gt
           sc4_s1Gu
           (GHC.Prim.+# sc5_s1Gv 1)
           sc6_s1Gw
           s2#1_aS8
         }
         };
       GHC.Types.True -> (# sc7_s1Gx, GHC.Unit.() #)
     }
 end Rec }
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4943#comment:1>
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