summaryrefslogtreecommitdiff
path: root/compiler/simplStg
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2016-02-24 16:22:36 -0500
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2016-02-24 16:41:55 -0500
commita9dc62ae3a28a7c5fc173895f148e65c6ffc14de (patch)
treeb52e5881bfaa2438233aea75fdc2420a62322ba8 /compiler/simplStg
parentd8c64e86361f6766ebe26a262bb229fb8301a42a (diff)
downloadhaskell-a9dc62ae3a28a7c5fc173895f148e65c6ffc14de.tar.gz
Remove "use mask" from StgAlt syntax
Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1933
Diffstat (limited to 'compiler/simplStg')
-rw-r--r--compiler/simplStg/StgStats.hs2
-rw-r--r--compiler/simplStg/UnariseStg.hs25
2 files changed, 9 insertions, 18 deletions
diff --git a/compiler/simplStg/StgStats.hs b/compiler/simplStg/StgStats.hs
index 5860f61057..2c72266ad6 100644
--- a/compiler/simplStg/StgStats.hs
+++ b/compiler/simplStg/StgStats.hs
@@ -168,6 +168,6 @@ statExpr (StgCase expr _ _ alts)
countOne StgCases
where
stat_alts alts
- = combineSEs (map statExpr [ e | (_,_,_,e) <- alts ])
+ = combineSEs (map statExpr [ e | (_,_,e) <- alts ])
statExpr (StgLam {}) = panic "statExpr StgLam"
diff --git a/compiler/simplStg/UnariseStg.hs b/compiler/simplStg/UnariseStg.hs
index 705fce01b3..c2d73a564c 100644
--- a/compiler/simplStg/UnariseStg.hs
+++ b/compiler/simplStg/UnariseStg.hs
@@ -131,16 +131,15 @@ unariseExpr us rho (StgTick tick e)
------------------------
unariseAlts :: UniqSupply -> UnariseEnv -> AltType -> Id -> [StgAlt] -> [StgAlt]
-unariseAlts us rho (UbxTupAlt n) bndr [(DEFAULT, [], [], e)]
- = [(DataAlt (tupleDataCon Unboxed n), ys, uses, unariseExpr us2' rho' e)]
+unariseAlts us rho (UbxTupAlt n) bndr [(DEFAULT, [], e)]
+ = [(DataAlt (tupleDataCon Unboxed n), ys, unariseExpr us2' rho' e)]
where
(us2', rho', ys) = unariseIdBinder us rho bndr
- uses = replicate (length ys) (not (isDeadBinder bndr))
-unariseAlts us rho (UbxTupAlt n) bndr [(DataAlt _, ys, uses, e)]
- = [(DataAlt (tupleDataCon Unboxed n), ys', uses', unariseExpr us2' rho'' e)]
+unariseAlts us rho (UbxTupAlt n) bndr [(DataAlt _, ys, e)]
+ = [(DataAlt (tupleDataCon Unboxed n), ys', unariseExpr us2' rho'' e)]
where
- (us2', rho', ys', uses') = unariseUsedIdBinders us rho ys uses
+ (us2', rho', ys') = unariseIdBinders us rho ys
rho'' = extendVarEnv rho' bndr ys'
unariseAlts _ _ (UbxTupAlt _) _ alts
@@ -151,10 +150,10 @@ unariseAlts us rho _ _ alts
--------------------------
unariseAlt :: UniqSupply -> UnariseEnv -> StgAlt -> StgAlt
-unariseAlt us rho (con, xs, uses, e)
- = (con, xs', uses', unariseExpr us' rho' e)
+unariseAlt us rho (con, xs, e)
+ = (con, xs', unariseExpr us' rho' e)
where
- (us', rho', xs', uses') = unariseUsedIdBinders us rho xs uses
+ (us', rho', xs') = unariseIdBinders us rho xs
------------------------
unariseArgs :: UnariseEnv -> [StgArg] -> [StgArg]
@@ -179,14 +178,6 @@ unariseId rho x
, text "unariseId: was unboxed tuple" <+> ppr x )
[x]
-unariseUsedIdBinders :: UniqSupply -> UnariseEnv -> [Id] -> [Bool]
- -> (UniqSupply, UnariseEnv, [Id], [Bool])
-unariseUsedIdBinders us rho xs uses
- = case mapAccumL2 do_one us rho (zipEqual "unariseUsedIdBinders" xs uses) of
- (us', rho', xs_usess) -> uncurry ((,,,) us' rho') (unzip (concat xs_usess))
- where
- do_one us rho (x, use) = third3 (map (flip (,) use)) (unariseIdBinder us rho x)
-
unariseIdBinders :: UniqSupply -> UnariseEnv -> [Id] -> (UniqSupply, UnariseEnv, [Id])
unariseIdBinders us rho xs = third3 concat $ mapAccumL2 unariseIdBinder us rho xs