Simon Peyton Jones pushed to branch wip/andreask/spec_tyfams at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Core/Opt/Specialise.hs
    ... ... @@ -17,6 +17,7 @@ import GHC.Core.Type hiding( substTy, substCo, extendTvSubst, zapSubst )
    17 17
     -- import GHC.Core.Multiplicity
    
    18 18
     import GHC.Core.SimpleOpt( defaultSimpleOpts, simpleOptExprWith, exprIsConApp_maybe )
    
    19 19
     import GHC.Core.Predicate
    
    20
    +import GHC.Core.Class( classMethods )
    
    20 21
     import GHC.Core.Coercion( Coercion )
    
    21 22
     import GHC.Core.Opt.Monad
    
    22 23
     import qualified GHC.Core.Subst as Core
    
    ... ... @@ -1646,10 +1647,10 @@ specCalls spec_imp env existing_rules calls_for_me fn rhs
    1646 1647
     --      See Note [Inline specialisations] for why we do not
    
    1647 1648
     --      switch off specialisation for inline functions
    
    1648 1649
     
    
    1649
    -  = pprTrace "specCalls: some" (vcat
    
    1650
    -      [ text "function" <+> ppr fn
    
    1651
    -      , text "calls:" <+> ppr calls_for_me
    
    1652
    -      , text "subst" <+> ppr (se_subst env) ]) $
    
    1650
    +  = -- pprTrace "specCalls: some" (vcat
    
    1651
    +    --  [ text "function" <+> ppr fn
    
    1652
    +    --  , text "calls:" <+> ppr calls_for_me
    
    1653
    +    --  , text "subst" <+> ppr (se_subst env) ]) $
    
    1653 1654
         foldlM spec_call ([], [], emptyUDs) calls_for_me
    
    1654 1655
     
    
    1655 1656
       | otherwise   -- No calls or RHS doesn't fit our preconceptions
    
    ... ... @@ -1705,7 +1706,7 @@ specCalls spec_imp env existing_rules calls_for_me fn rhs
    1705 1706
                  , rule_bndrs, rule_lhs_args
    
    1706 1707
                  , spec_bndrs1, dx_binds, spec_args) <- specHeader env rhs_bndrs all_call_args
    
    1707 1708
     
    
    1708
    -          ; when True $ pprTrace "spec_call" (vcat
    
    1709
    +          ; when False $ pprTrace "spec_call" (vcat
    
    1709 1710
                    [ text "fun:       "  <+> ppr fn
    
    1710 1711
                    , text "call info: "  <+> ppr _ci
    
    1711 1712
                    , text "useful:    "  <+> ppr useful
    
    ... ... @@ -3034,7 +3035,7 @@ mkCallUDs' :: SpecEnv -> Id -> [OutExpr] -> UsageDetails
    3034 3035
     mkCallUDs' env f args
    
    3035 3036
       | wantCallsFor env f    -- We want it, and...
    
    3036 3037
       , not (null ci_key)     -- this call site has a useful specialisation
    
    3037
    -  = pprTrace "mkCallUDs: keeping" _trace_doc
    
    3038
    +  = -- pprTrace "mkCallUDs: keeping" _trace_doc
    
    3038 3039
         singleCall env f ci_key
    
    3039 3040
     
    
    3040 3041
       | otherwise  -- See also Note [Specialisations already covered]