Commit 263a30f1 authored by rl@cse.unsw.edu.au's avatar rl@cse.unsw.edu.au
Browse files

Fix bug in vectorised DataCon worker generation

parent cd8f2b53
......@@ -352,7 +352,7 @@ vectDataConWorker shape vect_tc arr_tc arr_dc orig_dc vect_dc pre (dc_tys : post
args <- mapM (newLocalVar FSLIT("xs")) arr_tys
shapes <- shapeReplicate shape
(Var len)
(mkIntLitInt $ dataConTag vect_dc)
(mkDataConTag vect_dc)
empty_pre <- mapM emptyPA (concat pre)
empty_post <- mapM emptyPA (concat post)
......
module VectUtils (
collectAnnTypeBinders, collectAnnTypeArgs, isAnnTypeArg,
collectAnnValBinders,
mkDataConTag,
splitClosureTy,
mkPADictType, mkPArrayType,
paDictArgType, paDictOfType, paDFunType,
......@@ -23,7 +24,7 @@ import CoreUtils
import Type
import TypeRep
import TyCon
import DataCon ( dataConWrapId )
import DataCon ( DataCon, dataConWrapId, dataConTag )
import Var
import Id ( mkWildId )
import MkId ( unwrapFamInstScrut )
......@@ -58,6 +59,9 @@ isAnnTypeArg :: AnnExpr b ann -> Bool
isAnnTypeArg (_, AnnType t) = True
isAnnTypeArg _ = False
mkDataConTag :: DataCon -> CoreExpr
mkDataConTag dc = mkConApp intDataCon [mkIntLitInt $ dataConTag dc]
isClosureTyCon :: TyCon -> Bool
isClosureTyCon tc = tyConName tc == closureTyConName
......
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