summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2022-10-24 21:10:13 +0200
committerSebastian Graf <sebastian.graf@kit.edu>2022-10-24 21:10:15 +0200
commitfda71f5377a8905f1e4291aa7175b65a7b0fd445 (patch)
treea9bc18fe59b793adbf58f43ecdffc22be815a88f
parentf0a90c117ac598504ccb6514de77355de7415c86 (diff)
downloadhaskell-wip/make-exn-div-less-special.tar.gz
DmdAnal: Make exnDiv behave like topDivwip/make-exn-div-less-special
... except for the purposes of dead code eliminaiton. As far as DmdAnal is concerned, `topDiv` and `exnDiv` used to differ simply in their `defaultArgDmd`. NoFib suggests that nothing is lost by making the `defaultArgDmd` of `exnDiv` return `topDmd` instead of `absDmd`. (Of course the main purpose of `exnDiv` remains: dead code elimination.) In the interest of simplification we should make `topDiv` and `exnDiv` as similar as possible.
-rw-r--r--compiler/GHC/Types/Demand.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Types/Demand.hs b/compiler/GHC/Types/Demand.hs
index 71693748e0..b4cf78829c 100644
--- a/compiler/GHC/Types/Demand.hs
+++ b/compiler/GHC/Types/Demand.hs
@@ -1473,7 +1473,7 @@ defaultArgDmd :: Divergence -> Demand
defaultArgDmd Dunno = topDmd
-- NB: not botDmd! We don't want to mask the precise exception by forcing the
-- argument. But it is still absent.
-defaultArgDmd ExnOrDiv = absDmd
+defaultArgDmd ExnOrDiv = topDmd
defaultArgDmd Diverges = botDmd
{- Note [Precise vs imprecise exceptions]