From: simonmar Date: Tue, 9 Aug 2005 13:21:13 +0000 (+0000) Subject: [project @ 2005-08-09 13:21:13 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~260 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fe1f6b03e7f151fcd27170046e2116fd7f400d4d;p=ghc-hetmet.git [project @ 2005-08-09 13:21:13 by simonmar] mapUFM was strict in the structure of the tree, perhaps accidentally. In any case, this interacted badly with the use of mapVarEnv in SimplEnv.mkCoreSubst, which assumed that the map was lazy. mapUFM is now lazy in the structure of the tree, which matches the behaviour of FiniteMap.mapFM. This fixes some long compilation times, in particular HTMLMonad98.hs from WASH used to take 2 mins to compile without optimisation, now takes less than 20 seconds. --- diff --git a/ghc/compiler/utils/UniqFM.lhs b/ghc/compiler/utils/UniqFM.lhs index d2676bf..225dc33 100644 --- a/ghc/compiler/utils/UniqFM.lhs +++ b/ghc/compiler/utils/UniqFM.lhs @@ -717,10 +717,10 @@ insert_ele f n@(NodeUFM j p t1 t2) i a \begin{code} map_tree f (NodeUFM j p t1 t2) - = mkSSNodeUFM (NodeUFMData j p) (map_tree f t1) (map_tree f t2) + = mkLLNodeUFM (NodeUFMData j p) (map_tree f t1) (map_tree f t2) + -- NB. lazy! we know the tree is well-formed. map_tree f (LeafUFM i obj) = mkLeafUFM i (f obj) - map_tree f _ = panic "map_tree failed" \end{code}