[GHC] #10844: CallStack should not be inlined
GHC
ghc-devs at haskell.org
Tue Oct 4 21:07:47 UTC 2016
#10844: CallStack should not be inlined
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner: gridaphobe
Type: task | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1259
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
Well the apppend-string rule is in `PrelRules.lhs`:
{{{
match_append_lit :: [Expr CoreBndr] -> Maybe (Expr CoreBndr)
match_append_lit [Type ty1,
Lit (MachStr s1),
c1,
Var unpk `App` Type ty2
`App` Lit (MachStr s2)
`App` c2
`App` n
]
= ...
}}}
Notice that it maches only on actual literal strings. If they are floated
to top level they'll be replaced by a `Var`. Probably an `Id` whose
unfolding is the literal string, but still it won't match the above.
Instead you probably need to use `exprIsLiteral_maybe` as in
{{{
match_Word64ToInteger _ id_unf id [xl]
| Just (MachWord64 x) <- exprIsLiteral_maybe id_unf xl
= case splitFunTy_maybe (idType id) of
}}}
later in the same module.
Try that?
Indeed, ''every'' match on a `Lit` pattern in these rules should go via
`exprIsLiteralMaybe`. See if this works and then maybe at least open a
ticket for the others; preferably do them. Could be a big win!
Simon
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10844#comment:21>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list