Skip to content

Commit ad54717

Browse files
committed
Reduce number of warnings
We didn't ever look at missed-specialisations.
1 parent 0b395ac commit ad54717

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

accelerate.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ library
560560
-O2
561561
-Wall
562562
-Wcompat
563-
-Wmissed-specialisations
564563
-- -Wredundant-constraints
565564
-freduction-depth=100
566565
-fspec-constr-count=50

src/Data/Array/Accelerate/Debug/Internal/Stats.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ pprTickCount counts =
208208

209209
pprTickGroup :: [(Tick,Int)] -> Doc
210210
pprTickGroup [] = error "pprTickGroup"
211-
pprTickGroup grp =
211+
pprTickGroup grp@((groupRepr, _) : _) =
212212
hang 2 (vcat $ (pretty groupTotal <+> groupName)
213213
: [ pretty n <+> pprTickCtx t | (t,n) <- sortBy (flip (comparing snd)) grp ])
214214
where
215-
groupName = tickToStr (fst (head grp))
215+
groupName = tickToStr groupRepr
216216
groupTotal = sum [n | (_,n) <- grp]
217217

218218
tickToTag :: Tick -> Int

src/Data/Array/Accelerate/Pretty/Graphviz.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,11 @@ prettyDelayedOpenAcc detail ctx aenv (Manifest pacc) =
216216
p' <- prettyDelayedAfun detail aenv p
217217
f' <- prettyDelayedAfun detail aenv f
218218
--
219-
let PNode _ (Leaf (Nothing,xb)) fvs = x'
220-
loop = nest 2 (sep ["awhile", pretty p', pretty f', xb ])
221-
return $ PNode ident (Leaf (Nothing,loop)) fvs
219+
case x' of
220+
PNode _ (Leaf (Nothing,xb)) fvs ->
221+
let loop = nest 2 (sep ["awhile", pretty p', pretty f', xb ])
222+
in return $ PNode ident (Leaf (Nothing,loop)) fvs
223+
_ -> internalError "replant did not return a Leaf"
222224

223225
Apair a1 a2 -> genNodeId >>= prettyDelayedApair detail aenv a1 a2
224226

src/Data/Array/Accelerate/Trafo/Sharing.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import Control.Monad.Fix
7676
import Data.Function ( on )
7777
import Data.Hashable
7878
import Data.List ( elemIndex, findIndex, groupBy, partition )
79+
import qualified Data.List.NonEmpty as NE
7980
import Data.Maybe
8081
import Data.Monoid ( Any(..) )
8182
import Data.Text.Lazy.Builder
@@ -819,10 +820,10 @@ convertSharingExp config lyt alyt env aenv exp@(ScopedExp lams _) = cvt exp
819820
nested :: HasCallStack => AST.OpenExp env' aenv' a -> [(TagR a, AST.OpenExp env' aenv' b)] -> AST.OpenExp env' aenv' b
820821
nested _ [(_,r)] = r
821822
nested s rs =
822-
let groups = groupBy (eqT `on` fst) rs
823-
tags = map (firstT . fst . head) groups
823+
let groups = NE.groupBy (eqT `on` fst) rs
824+
tags = map (firstT . fst . NE.head) groups
824825
e = prjT (fst (head rs)) s
825-
rhs = map (nested s . map (over _1 ignore)) groups
826+
rhs = map (nested s . map (over _1 ignore) . NE.toList) groups
826827
in
827828
AST.Case e (zip tags rhs) Nothing
828829

@@ -1108,8 +1109,8 @@ freezeOccMap oc
11081109
traceChunk "OccMap" (fromString (show ocl))
11091110

11101111
return . IntMap.fromList
1111-
. map (\kvs -> (key (head kvs), kvs))
1112-
. groupBy sameKey
1112+
. map (\kvs -> (key (NE.head kvs), NE.toList kvs))
1113+
. NE.groupBy sameKey
11131114
. map dropHeight
11141115
$ ocl
11151116
where

src/Data/Array/Accelerate/Trafo/Shrink.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ strengthenShrunkLHS (LeftHandSideSingle _) (LeftHandSideWildcard _) k = \ix ->
217217
SuccIdx ix' -> k ix'
218218
strengthenShrunkLHS (LeftHandSidePair l h) (LeftHandSideWildcard t) k = strengthenShrunkLHS h (LeftHandSideWildcard t2) $ strengthenShrunkLHS l (LeftHandSideWildcard t1) k
219219
where
220-
TupRpair t1 t2 = t
220+
(t1, t2) = case t of TupRpair t1' t2' -> (t1', t2')
221+
_ -> internalError "Pair type was not TupRpair"
221222
strengthenShrunkLHS (LeftHandSideWildcard _) _ _ = internalError "Second LHS defines more variables"
222223
strengthenShrunkLHS _ _ _ = internalError "Mismatch LHS single with LHS pair"
223224

0 commit comments

Comments
 (0)