diff options
Diffstat (limited to 'docs/users_guide/using-optimisation.rst')
-rw-r--r-- | docs/users_guide/using-optimisation.rst | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst index 6b58093513..3e660c19e9 100644 --- a/docs/users_guide/using-optimisation.rst +++ b/docs/users_guide/using-optimisation.rst @@ -115,7 +115,7 @@ list. :default: on - Merge immediately-nested case expressions that scrutinse the same variable. + Merge immediately-nested case expressions that scrutinise the same variable. For example, :: case x of @@ -131,6 +131,25 @@ list. Blue -> e2 Green -> e2 +.. ghc-flag:: -fcase-folding + + :default: on + + Allow constant folding in case expressions that scrutinise some primops: + For example, :: + + case x `minusWord#` 10## of + 10## -> e1 + 20## -> e2 + v -> e3 + + Is transformed to, :: + + case x of + 20## -> e1 + 30## -> e2 + _ -> let v = x `minusWord#` 10## in e3 + .. ghc-flag:: -fcall-arity :default: on |