From: Ian Lynagh Date: Tue, 19 Oct 2010 20:15:37 +0000 (+0000) Subject: Define setIdUnfoldingLazily, and use it in Vectorise X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=8e5442bab1ca5cd9239690af664374cac585f8b2 Define setIdUnfoldingLazily, and use it in Vectorise Fixes a loop in the compiler, when running the dph tests --- diff --git a/compiler/basicTypes/Id.lhs b/compiler/basicTypes/Id.lhs index 3640693..d8771bc 100644 --- a/compiler/basicTypes/Id.lhs +++ b/compiler/basicTypes/Id.lhs @@ -76,6 +76,7 @@ module Id ( idOccInfo, -- ** Writing 'IdInfo' fields + setIdUnfoldingLazily, setIdUnfolding, setIdArity, setIdDemandInfo, @@ -119,7 +120,8 @@ import Util( count ) import StaticFlags -- infixl so you can say (id `set` a `set` b) -infixl 1 `setIdUnfolding`, +infixl 1 `setIdUnfoldingLazily`, + `setIdUnfolding`, `setIdArity`, `setIdOccInfo`, `setIdDemandInfo`, @@ -496,6 +498,9 @@ realIdUnfolding :: Id -> Unfolding -- Expose the unfolding if there is one, including for loop breakers realIdUnfolding id = unfoldingInfo (idInfo id) +setIdUnfoldingLazily :: Id -> Unfolding -> Id +setIdUnfoldingLazily id unfolding = modifyIdInfo (`setUnfoldingInfoLazily` unfolding) id + setIdUnfolding :: Id -> Unfolding -> Id setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index 8e04833..223d88b 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -168,7 +168,7 @@ vectTopBinder var inline expr vty <- vectType (idType var) -- Make the vectorised version of binding's name, and set the unfolding used for inlining. - var' <- liftM (`setIdUnfolding` unfolding) + var' <- liftM (`setIdUnfoldingLazily` unfolding) $ cloneId mkVectOcc var vty -- Add the mapping between the plain and vectorised name to the state.