[commit: ghc] supercompiler: Make impossible-alternative-finding code more reusable (4fc8355)
Max Bolingbroke <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.cvs.ghc |
|---|---|
| Message-ID | <[email protected]> |
Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : supercompiler http://hackage.haskell.org/trac/ghc/changeset/4fc83553450e55131dfcd3593f0d2f619555d3a3 >--------------------------------------------------------------- commit 4fc83553450e55131dfcd3593f0d2f619555d3a3 Author: Max Bolingbroke <[email protected]> Date: Fri Jan 6 09:36:05 2012 +0000 Make impossible-alternative-finding code more reusable Makes the following changes: 1. Generalises the type signatures of some functions relating to alternatives so that the type of "variables" and "expression" is not specified 2. Puts the bulk of the alternative-filtering code into a new function filterAlts (in CoreUtils) that can be used outside of the SimplM monad 3. Allows prepareAlts to return a null alternatives list if none are applicable - it turns out that this case was already handled by the caller (in the simplifier). This should result in a modest optimisation improvement in some cases. >--------------------------------------------------------------- compiler/simplCore/SimplUtils.lhs | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/compiler/simplCore/SimplUtils.lhs b/compiler/simplCore/SimplUtils.lhs index 87aefba..e669551 100644 --- a/compiler/simplCore/SimplUtils.lhs +++ b/compiler/simplCore/SimplUtils.lhs @@ -13,7 +13,7 @@ module SimplUtils ( -- Rebuilding - mkLam, mkCase, prepareAlts, tryEtaExpand, + mkLam, mkCase, prepareAlts, filterAlts, tryEtaExpand, -- Inlining, preInlineUnconditionally, postInlineUnconditionally,