[commit: ghc] wip/T13861: WIP: lump with DEFAULT (35e0ef1)
git at git.haskell.org
git at git.haskell.org
Fri Dec 29 12:28:23 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T13861
Link : http://ghc.haskell.org/trac/ghc/changeset/35e0ef1ac7d59ff6298d8a1795d5fd2148a2c5f6/ghc
>---------------------------------------------------------------
commit 35e0ef1ac7d59ff6298d8a1795d5fd2148a2c5f6
Author: Gabor Greif <ggreif at gmail.com>
Date: Fri Dec 29 12:47:59 2017 +0100
WIP: lump with DEFAULT
>---------------------------------------------------------------
35e0ef1ac7d59ff6298d8a1795d5fd2148a2c5f6
compiler/simplStg/StgCse.hs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/compiler/simplStg/StgCse.hs b/compiler/simplStg/StgCse.hs
index 960c254..6b805d7 100644
--- a/compiler/simplStg/StgCse.hs
+++ b/compiler/simplStg/StgCse.hs
@@ -420,9 +420,10 @@ mkStgCase scrut bndr ty alts | all isBndr alts = scrut
isBndr (_, _, StgApp f []) = f == bndr
isBndr _ = False
-- see Note [Lumping alternatives together]
- grouped (def@(DEFAULT, _, _) : alts) | isBndr def
- , (binds@(_:_),rest) <- partition isBndr alts
- = pprTrace "mkStgCaseDEFAULT" (ppr alts) $ Just (def:rest)
+ grouped (def@(DEFAULT, _, _) : alts)
+ | isBndr def
+ , (binds@(_:_),rest) <- partition isBndr alts
+ = pprTrace "mkStgCase" (ppr alts) $ Just (def:rest)
grouped alts | (binds@(_:_:_),rest) <- partition isBndr alts
= Just ((DEFAULT, [], StgApp bndr []) : rest)
-- TODO: common constr applications: partition, sort, group
More information about the ghc-commits
mailing list