Commit bd1aaa42 authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.

Special case 'patError' in the vectoriser

parent 39e4c620
......@@ -62,7 +62,8 @@ vectPolyExpr loop_breaker recFns expr
(tvs, mono) = collectAnnTypeBinders expr
-- | Vectorise an expression.
-- |Vectorise an expression.
--
vectExpr :: CoreExprWithFVs -> VM VExpr
vectExpr (_, AnnType ty)
= liftM vType (vectType ty)
......@@ -76,6 +77,17 @@ vectExpr (_, AnnLit lit)
vectExpr (_, AnnNote note expr)
= liftM (vNote note) (vectExpr expr)
-- SPECIAL CASE: Vectorise/lift 'patError @ ty err' by only vectorising/lifting the type 'ty';
-- its only purpose is to abort the program, but we need to adjust the type to keep CoreLint
-- happy.
vectExpr (_, AnnApp (_, AnnApp (_, AnnVar v) (_, AnnType ty)) err)
| v == pAT_ERROR_ID
= do { (vty, lty) <- vectAndLiftType ty
; return (mkCoreApps (Var v) [Type vty, err'], mkCoreApps (Var v) [Type lty, err'])
}
where
err' = deAnnotate err
vectExpr e@(_, AnnApp _ arg)
| isAnnTypeArg arg
= vectTyAppExpr fn tys
......
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