diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-01-13 17:50:00 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-01-13 17:50:00 +0000 |
commit | 601c983dd0bada6b49bdadd8f172fd4eacac4b0c (patch) | |
tree | 58c99eb2753958b5a0192ec050a385b9badcc847 /mk/build.mk.sample | |
parent | c96022cbfae44ea9180b78e3c37467613ac98cec (diff) | |
download | haskell-601c983dd0bada6b49bdadd8f172fd4eacac4b0c.tar.gz |
Add -faggressive-primops plus refactoring in CoreUtils
I'm experimenting with making GHC a bit more aggressive about
a) dropping case expressions if the result is unused
Simplify.rebuildCase, CaseElim equation
b) floating case expressions inwards
FloatIn.fiExpr, AnnCase
In both cases the new behaviour is gotten with a static (debug)
flag -faggressive-primops. The extra "aggression" is to allow
discarding and floating in for side-effecting operations. See
the new, extensive Note [PrimOp can_fail and has_side_effects]
in PrimoOp.
When discarding a case with unused binders, in the lifted-type
case it's definitely ok if the scrutinee terminates; previously
we were checking exprOkForSpeculation, which is significantly
worse.
So I wanted a new function CoreUtils.exprCertainlyTerminates.
In doing this I ended up with a significant refactoring in
CoreUtils. The new structure has quite a lot of nice sharing:
exprIsCheap = exprIsCheap' isHNFApp
exprIsExpandable = exprIsCheap' isConLikeApp
exprIsHNF = exprIsHNFlike isHNFApp
exprIsConLike = exprIsHNFlike isConLikeApp
exprCertainlyTerminates = exprIsHNFlike isTerminatingApp
Diffstat (limited to 'mk/build.mk.sample')
0 files changed, 0 insertions, 0 deletions