diff options
author | Roman Leshchinskiy <rl@cse.unsw.edu.au> | 2008-09-11 05:43:33 +0000 |
---|---|---|
committer | Roman Leshchinskiy <rl@cse.unsw.edu.au> | 2008-09-11 05:43:33 +0000 |
commit | 5ac946878d18294ff30e3d9cf152c678c667e37b (patch) | |
tree | d8df461aa281f0db46875f882ff7ddc4a9716744 /compiler | |
parent | dab80474aec701dab215ed0f9b9bfa904083182a (diff) | |
download | haskell-5ac946878d18294ff30e3d9cf152c678c667e37b.tar.gz |
Don't panic on non-vectorisable expressions
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/vectorise/VectMonad.hs | 3 | ||||
-rw-r--r-- | compiler/vectorise/VectType.hs | 2 | ||||
-rw-r--r-- | compiler/vectorise/Vectorise.hs | 10 |
3 files changed, 6 insertions, 9 deletions
diff --git a/compiler/vectorise/VectMonad.hs b/compiler/vectorise/VectMonad.hs index 7a25c8ddd2..ecbc7d9700 100644 --- a/compiler/vectorise/VectMonad.hs +++ b/compiler/vectorise/VectMonad.hs @@ -2,7 +2,8 @@ module VectMonad ( Scope(..), VM, - noV, tryV, maybeV, traceMaybeV, orElseV, fixV, localV, closedV, initV, + noV, traceNoV, tryV, maybeV, traceMaybeV, orElseV, fixV, localV, closedV, + initV, liftDs, cloneName, cloneId, cloneVar, newExportedVar, newLocalVar, newDummyVar, newTyVar, diff --git a/compiler/vectorise/VectType.hs b/compiler/vectorise/VectType.hs index 53c8a61f05..ae77d05b47 100644 --- a/compiler/vectorise/VectType.hs +++ b/compiler/vectorise/VectType.hs @@ -86,7 +86,7 @@ vectType ty@(ForAllTy _ _) where (tyvars, mono_ty) = splitForAllTys ty -vectType ty = pprPanic "vectType:" (ppr ty) +vectType ty = traceNoV "vectType: can't vectorise" (ppr ty) vectAndBoxType :: Type -> VM Type vectAndBoxType ty = vectType ty >>= boxType diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index fb76430f8b..1c8e19ca5d 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -250,9 +250,6 @@ vectExpr (_, AnnCase scrut bndr ty alts) where scrut_ty = exprType (deAnnotate scrut) -vectExpr (_, AnnCase _ _ _ _) - = panic "vectExpr: case" - vectExpr (_, AnnLet (AnnNonRec bndr rhs) body) = do vrhs <- localV . inBind bndr $ vectPolyExpr rhs @@ -274,12 +271,11 @@ vectExpr (_, AnnLet (AnnRec bs) body) $ vectExpr rhs vectExpr e@(fvs, AnnLam bndr _) - | not (isId bndr) = pprPanic "vectExpr" (ppr $ deAnnotate e) - | otherwise = vectLam fvs bs body + | isId bndr = vectLam fvs bs body where (bs,body) = collectAnnValBinders e -vectExpr e = pprPanic "vectExpr" (ppr $ deAnnotate e) +vectExpr e = traceNoV "vectExpr: can't vectorise" (ppr $ deAnnotate e) vectLam :: VarSet -> [Var] -> CoreExprWithFVs -> VM VExpr vectLam fvs bs body @@ -302,7 +298,7 @@ vectLam fvs bs body vectTyAppExpr :: CoreExprWithFVs -> [Type] -> VM VExpr vectTyAppExpr (_, AnnVar v) tys = vectPolyVar v tys -vectTyAppExpr e _ = pprPanic "vectTyAppExpr" (ppr $ deAnnotate e) +vectTyAppExpr e _ = traceNoV "vectTyAppExpr: can't vectorise" (ppr $ deAnnotate e) -- We convert -- |