diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-09-10 16:55:21 +1000 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-09-10 16:59:44 +1000 |
commit | 4d7033df4912e0efc85ad37555897d7b33651a0b (patch) | |
tree | 04f9ead23e5b1ec83713c0afe448a8c9f4c28e36 /compiler/vectorise/Vectorise.hs | |
parent | b3bc5f4f49a01be12aff0e4369db62331c147179 (diff) | |
download | haskell-4d7033df4912e0efc85ad37555897d7b33651a0b.tar.gz |
Report bindings that cannot be vectorised
- Toplevel bindings that cannot be vectorised are reported as a warning
- '-ddump-vt-trace' has even more information about unvectorised code
- Fixed some documentation
Diffstat (limited to 'compiler/vectorise/Vectorise.hs')
-rw-r--r-- | compiler/vectorise/Vectorise.hs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index c699441bb9..649f33f2db 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -146,8 +146,10 @@ vectTopBind b@(NonRec var expr) ; hs <- takeHoisted ; return . Rec $ (var, cexpr) : (var', expr') : hs } - `orElseV` - return b + `orElseErrV` + do { emitVt " Could NOT vectorise top-level binding" $ ppr var + ; return b + } where unlessNoVectDecl vectorise = do { hasNoVectDecl <- noVectDecl var @@ -184,7 +186,7 @@ vectTopBind b@(Rec bs) ; cexprs <- sequence $ zipWith3 tryConvert vars vars' exprs ; return . Rec $ zip vars cexprs ++ zip vars' exprs' ++ hs } - `orElseV` + `orElseErrV` return b where (vars, exprs) = unzip bs @@ -309,8 +311,8 @@ vectTopRhs recFs var expr info False vectDecl | isJust vectDecl = " [VECTORISE]" | otherwise = " (no pragma)" --- | Project out the vectorised version of a binding from some closure, --- or return the original body if that doesn't work or the binding is scalar. +-- |Project out the vectorised version of a binding from some closure, +-- or return the original body if that doesn't work or the binding is scalar. -- tryConvert :: Var -- ^ Name of the original binding (eg @foo@) -> Var -- ^ Name of vectorised version of binding (eg @$vfoo@) @@ -322,5 +324,9 @@ tryConvert var vect_var rhs then return rhs else - fromVect (idType var) (Var vect_var) `orElseV` return rhs + fromVect (idType var) (Var vect_var) + `orElseErrV` + do { emitVt " Could NOT call vectorised from original version" $ ppr var + ; return rhs + } } |