summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2022-07-09 18:16:46 +0200
committerAndreas Klebinger <klebinger.andreas@gmx.at>2022-07-09 18:16:46 +0200
commitceff0bb19257e3da0675f81f23b21a80a525d57d (patch)
tree80925ed019b5b6f53de79e58c11d15d482e21a30
parentcb0e0ffd43a096ffe3ebb05cfb02e1ff742dd717 (diff)
downloadhaskell-wip/andreas/opt-fvs.tar.gz
-rw-r--r--compiler/GHC/Utils/FV.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/GHC/Utils/FV.hs b/compiler/GHC/Utils/FV.hs
index adcefa8c9c..a433032547 100644
--- a/compiler/GHC/Utils/FV.hs
+++ b/compiler/GHC/Utils/FV.hs
@@ -116,7 +116,7 @@ elemAcc v acc =
-- | Run a free variable computation, returning a list of distinct free
-- variables in deterministic order.
fvVarList :: FV -> [Var]
-fvVarList = \fv -> acc_list $ fv (const True) setEmpty emptyListAcc
+fvVarList fv = acc_list $ fv (const True) setEmpty emptyListAcc
-- | Run a free variable computation, returning a deterministic set of free
-- variables. Note that this is just a wrapper around the version that
@@ -129,7 +129,7 @@ fvDVarSet = mkDVarSet . fvVarList
-- free variables. Don't use if the set will be later converted to a list
-- and the order of that list will impact the generated code.
fvVarSet :: FV -> VarSet
-fvVarSet = \fv -> case fv (const True) setEmpty emptySetAcc of
+fvVarSet fv = case fv (const True) setEmpty emptySetAcc of
SetAcc s -> s
_ -> panic "Invalid fvs accum"
@@ -194,7 +194,8 @@ unionFV fv1 fv2 fv_cand in_scope acc =
-- | Mark the variable as not free by putting it in scope.
delFV :: Var -> FV -> FV
delFV var fv fv_cand !in_scope acc =
- fv fv_cand (setInsert (getUnique var) in_scope) acc
+ let !scope = (setInsert (getUnique var) in_scope)
+ in fv fv_cand scope acc
{-# INLINE delFV #-}
-- | Mark many free variables as not free.