Commit 8e5442ba authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Define setIdUnfoldingLazily, and use it in Vectorise

Fixes a loop in the compiler, when running the dph tests
parent 6193ff06
...@@ -76,6 +76,7 @@ module Id ( ...@@ -76,6 +76,7 @@ module Id (
idOccInfo, idOccInfo,
-- ** Writing 'IdInfo' fields -- ** Writing 'IdInfo' fields
setIdUnfoldingLazily,
setIdUnfolding, setIdUnfolding,
setIdArity, setIdArity,
setIdDemandInfo, setIdDemandInfo,
...@@ -119,7 +120,8 @@ import Util( count ) ...@@ -119,7 +120,8 @@ import Util( count )
import StaticFlags import StaticFlags
-- infixl so you can say (id `set` a `set` b) -- infixl so you can say (id `set` a `set` b)
infixl 1 `setIdUnfolding`, infixl 1 `setIdUnfoldingLazily`,
`setIdUnfolding`,
`setIdArity`, `setIdArity`,
`setIdOccInfo`, `setIdOccInfo`,
`setIdDemandInfo`, `setIdDemandInfo`,
...@@ -496,6 +498,9 @@ realIdUnfolding :: Id -> Unfolding ...@@ -496,6 +498,9 @@ realIdUnfolding :: Id -> Unfolding
-- Expose the unfolding if there is one, including for loop breakers -- Expose the unfolding if there is one, including for loop breakers
realIdUnfolding id = unfoldingInfo (idInfo id) realIdUnfolding id = unfoldingInfo (idInfo id)
setIdUnfoldingLazily :: Id -> Unfolding -> Id
setIdUnfoldingLazily id unfolding = modifyIdInfo (`setUnfoldingInfoLazily` unfolding) id
setIdUnfolding :: Id -> Unfolding -> Id setIdUnfolding :: Id -> Unfolding -> Id
setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id setIdUnfolding id unfolding = modifyIdInfo (`setUnfoldingInfo` unfolding) id
......
...@@ -168,7 +168,7 @@ vectTopBinder var inline expr ...@@ -168,7 +168,7 @@ vectTopBinder var inline expr
vty <- vectType (idType var) vty <- vectType (idType var)
-- Make the vectorised version of binding's name, and set the unfolding used for inlining. -- 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 $ cloneId mkVectOcc var vty
-- Add the mapping between the plain and vectorised name to the state. -- Add the mapping between the plain and vectorised name to the state.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment