diff options
author | Roman Leshchinskiy <rl@cse.unsw.edu.au> | 2007-11-17 04:07:39 +0000 |
---|---|---|
committer | Roman Leshchinskiy <rl@cse.unsw.edu.au> | 2007-11-17 04:07:39 +0000 |
commit | 7c737416e30137e7053b4bcd0fdd563f07fa43b0 (patch) | |
tree | 559ed5f7e540f134d8b4302837da002089b6ab36 /compiler/vectorise/VectUtils.hs | |
parent | 7a5442f3bd91cc24c54c828529d8fee76aeec388 (diff) | |
download | haskell-7c737416e30137e7053b4bcd0fdd563f07fa43b0.tar.gz |
Incomplete support for boxing during vectorisation
Diffstat (limited to 'compiler/vectorise/VectUtils.hs')
-rw-r--r-- | compiler/vectorise/VectUtils.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/vectorise/VectUtils.hs b/compiler/vectorise/VectUtils.hs index 3e6143c398..a540b4d10c 100644 --- a/compiler/vectorise/VectUtils.hs +++ b/compiler/vectorise/VectUtils.hs @@ -346,6 +346,19 @@ takeHoisted setGEnv $ env { global_bindings = [] } return $ global_bindings env +boxExpr :: Type -> VExpr -> VM VExpr +boxExpr ty (vexpr, lexpr) + | Just (tycon, []) <- splitTyConApp_maybe ty + , isUnLiftedTyCon tycon + = do + r <- lookupBoxedTyCon tycon + case r of + Just tycon' -> let [dc] = tyConDataCons tycon' + in + return (mkConApp dc [vexpr], lexpr) + Nothing -> return (vexpr, lexpr) + + mkClosure :: Type -> Type -> Type -> VExpr -> VExpr -> VM VExpr mkClosure arg_ty res_ty env_ty (vfn,lfn) (venv,lenv) = do |