
#14816: Missed Called Arity opportunity?
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.2.2
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: Runtime
Unknown/Multiple | performance bug
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
When I compile
{{{#!hs
test :: (a -> a -> a) -> Int -> a -> HashMap Int a -> HashMap Int a
test f k a m = insertModifying a (blink (f a)) k m
blink :: (a -> b) -> a -> (# b #)
-- Or blink g = \a -> (# g a #) ; it makes no difference.
blink g a = (# g a #)
}}}
I get
{{{
test
= \ (@ a_a9o3)
(f_a7iP :: a_a9o3 -> a_a9o3 -> a_a9o3)
(k_a7iQ :: Int)
(a1_a7iR :: a_a9o3)
(m_a7iS :: HashMap Int a_a9o3) ->
case k_a7iQ of { GHC.Types.I# ww1_sa1Z ->
RULES.$w$sinsertModifying
@ a_a9o3
a1_a7iR
(let {
g_s9E1 [Dmd=,
Unf=OtherCon []] =
[] \r [f_saiX k_saiY a1_saiZ m_saj0]
case k_saiY of {
GHC.Types.I# ww1_saj2 [Occ=Once] ->
let {
g_saj3 [Occ=OnceL!, Dmd=