Commit 84ca819a authored by rl@cse.unsw.edu.au's avatar rl@cse.unsw.edu.au
Browse files

Handle unlifted tycons and tuples correctly during vectorisation

parent e7eb4e16
......@@ -297,7 +297,10 @@ lookupVar v
$ maybeV (readGEnv $ \env -> lookupVarEnv (global_vars env) v)
lookupTyCon :: TyCon -> VM (Maybe TyCon)
lookupTyCon tc = readGEnv $ \env -> lookupNameEnv (global_tycons env) (tyConName tc)
lookupTyCon tc
| isUnLiftedTyCon tc || isTupleTyCon tc = return (Just tc)
| otherwise = readGEnv $ \env -> lookupNameEnv (global_tycons env) (tyConName tc)
defTyCon :: TyCon -> TyCon -> VM ()
defTyCon tc tc' = updGEnv $ \env ->
......
......@@ -209,7 +209,13 @@ tyConsOfType :: Type -> UniqSet TyCon
tyConsOfType ty
| Just ty' <- coreView ty = tyConsOfType ty'
tyConsOfType (TyVarTy v) = emptyUniqSet
tyConsOfType (TyConApp tc tys) = tyConsOfTypes tys `addOneToUniqSet` tc
tyConsOfType (TyConApp tc tys) = extend (tyConsOfTypes tys)
where
extend | isUnLiftedTyCon tc
|| isTupleTyCon tc = id
| otherwise = (`addOneToUniqSet` tc)
tyConsOfType (AppTy a b) = tyConsOfType a `unionUniqSets` tyConsOfType b
tyConsOfType (FunTy a b) = (tyConsOfType a `unionUniqSets` tyConsOfType b)
`addOneToUniqSet` funTyCon
......
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