summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-02-28 16:00:49 -0500
committerDavid Feuer <David.Feuer@gmail.com>2017-02-28 16:00:50 -0500
commit55efc9718b520ef354e32c15c4b49cdfecce412f (patch)
treec9cc228cadd7bb9fb2d1a80f52bbc4fb70c8afee /testsuite/tests/numeric
parentdefef5276bf0997237ea5ecc448f686bb5e85940 (diff)
downloadhaskell-55efc9718b520ef354e32c15c4b49cdfecce412f.tar.gz
Combine identical case alternatives in CSE
See Note [Combine case alternatives] in CSE. This opportunity surfaced when I was was studying early inlining. It's easy (and cheap) to exploit, and sometimes makes a worthwhile saving. Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3194
Diffstat (limited to 'testsuite/tests/numeric')
-rw-r--r--testsuite/tests/numeric/should_compile/T7116.stdout16
1 files changed, 5 insertions, 11 deletions
diff --git a/testsuite/tests/numeric/should_compile/T7116.stdout b/testsuite/tests/numeric/should_compile/T7116.stdout
index ee136c24e5..681d171350 100644
--- a/testsuite/tests/numeric/should_compile/T7116.stdout
+++ b/testsuite/tests/numeric/should_compile/T7116.stdout
@@ -1,7 +1,7 @@
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 50, types: 25, coercions: 0, joins: 0/0}
+ = {terms: 36, types: 19, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
T7116.$trModule4 :: GHC.Prim.Addr#
@@ -64,7 +64,7 @@ dr
= \ (x :: Double) ->
case x of { GHC.Types.D# x1 -> GHC.Types.D# (GHC.Prim.+## x1 x1) }
--- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
dl :: Double -> Double
[GblId,
Arity=1,
@@ -75,9 +75,7 @@ dl :: Double -> Double
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (x [Occ=Once!] :: Double) ->
case x of { GHC.Types.D# y -> GHC.Types.D# (GHC.Prim.+## y y) }}]
-dl
- = \ (x :: Double) ->
- case x of { GHC.Types.D# y -> GHC.Types.D# (GHC.Prim.+## y y) }
+dl = dr
-- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
fr :: Float -> Float
@@ -98,7 +96,7 @@ fr
GHC.Types.F# (GHC.Prim.plusFloat# x1 x1)
}
--- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
fl :: Float -> Float
[GblId,
Arity=1,
@@ -111,11 +109,7 @@ fl :: Float -> Float
case x of { GHC.Types.F# y ->
GHC.Types.F# (GHC.Prim.plusFloat# y y)
}}]
-fl
- = \ (x :: Float) ->
- case x of { GHC.Types.F# y ->
- GHC.Types.F# (GHC.Prim.plusFloat# y y)
- }
+fl = fr