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 (
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
......
......@@ -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.
......
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