Fix bug in case vectorisation
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Sat, 17 Nov 2007 01:50:14 +0000 (01:50 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Sat, 17 Nov 2007 01:50:14 +0000 (01:50 +0000)
compiler/vectorise/Vectorise.hs

index 96ed01e..9f2e2b7 100644 (file)
@@ -435,7 +435,9 @@ packLiftingContext len shape tag fvs res_ty p
       lc_var <- builtin liftingContext
       localV $
         do
-          bnds <- mapM (packFreeVar (Var lc_var) (Var sel_var)) (varSetElems fvs)
+          bnds <- mapM (packFreeVar (Var lc_var) (Var sel_var))
+                . filter isLocalId
+                $ varSetElems fvs
           (vexpr, lexpr) <- p
           return (vexpr, Let (NonRec sel_var sel_expr)
                          $ Case len lc_var res_ty [(DEFAULT, [], lexpr)])