summaryrefslogtreecommitdiff
path: root/testsuite/tests/dependent/should_compile/all.T
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-06-07 11:03:21 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-06-07 11:05:56 +0100
commitc16382d57ed9bf51089a14f079404ff8b4ce6eb2 (patch)
treeeb12c5abb507e3cd3d57890454fc39ddf36828e2 /testsuite/tests/dependent/should_compile/all.T
parent7f45906428c97a097ca4d9e1f46d35495380bee1 (diff)
downloadhaskell-c16382d57ed9bf51089a14f079404ff8b4ce6eb2.tar.gz
Remove ad-hoc special case in occAnal
Back in 1999 I put this ad-hoc code in the Case-handling code for occAnal: occAnal env (Case scrut bndr ty alts) = ... -- Note [Case binder usage] -- ~~~~~~~~~~~~~~~~~~~~~~~~ -- The case binder gets a usage of either "many" or "dead", never "one". -- Reason: we like to inline single occurrences, to eliminate a binding, -- but inlining a case binder *doesn't* eliminate a binding. -- We *don't* want to transform -- case x of w { (p,q) -> f w } -- into -- case x of w { (p,q) -> f (p,q) } tag_case_bndr usage bndr = (usage', setIdOccInfo bndr final_occ_info) where occ_info = lookupDetails usage bndr usage' = usage `delDetails` bndr final_occ_info = case occ_info of IAmDead -> IAmDead _ -> noOccInfo But the comment looks wrong -- the bad inlining will not happen -- and I think it relates to some long-ago version of the simplifier. So I simply removed the special case, which gives more accurate occurrence-info to the case binder. Interestingly I got a slight improvement in nofib binary sizes. -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- cacheprof -0.1% +0.2% -0.7% -1.2% +8.6% -------------------------------------------------------------------------------- Min -0.2% 0.0% -14.5% -30.5% 0.0% Max -0.1% +0.2% +10.0% +10.0% +25.0% Geometric Mean -0.2% +0.0% -1.9% -5.4% +0.3% I have no idea if the improvement in runtime is real. I did look at the tiny increase in allocation for cacheprof and concluded that it was unimportant (I forget the details). Also the more accurate occ-info for the case binder meant that some inlining happens in one pass that previously took successive passes for the test dependent/should_compile/dynamic-paper (which has a known Russel-paradox infinite loop in the simplifier). In short, a small win: less ad-hoc complexity and slightly smaller binaries.
Diffstat (limited to 'testsuite/tests/dependent/should_compile/all.T')
-rw-r--r--testsuite/tests/dependent/should_compile/all.T2
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T
index 66221840bb..e153cafe41 100644
--- a/testsuite/tests/dependent/should_compile/all.T
+++ b/testsuite/tests/dependent/should_compile/all.T
@@ -17,7 +17,7 @@ test('T9632', normal, compile, [''])
# discussed in #11330.
test('dynamic-paper',
expect_broken_for(11330, ['profasm']),
- compile, [''])
+ compile_fail, [''])
test('T11311', normal, compile, [''])
test('T11405', normal, compile, [''])
test('T11241', normal, compile, [''])