Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarkePedersen committed Oct 31, 2023
1 parent e710f76 commit 6bbbf0d
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions src/Futhark/Analysis/AccessPattern.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ type IndexTable rep =

-- | SegOpName stores the nested "level" at which it is declared in the AST.
data SegOpName
= SegmentedMap VName
| SegmentedRed VName
| SegmentedScan VName
| SegmentedHist VName
= SegmentedMap {vnameFromSegOp :: VName}
| SegmentedRed {vnameFromSegOp :: VName}
| SegmentedScan {vnameFromSegOp :: VName}
| SegmentedHist {vnameFromSegOp :: VName}
deriving (Eq, Ord, Show)

type ArrayName = (VName, [BodyType])

type IndexExprName = VName

vnameFromSegOp :: SegOpName -> VName
vnameFromSegOp (SegmentedMap name) = name
vnameFromSegOp (SegmentedRed name) = name
vnameFromSegOp (SegmentedScan name) = name
vnameFromSegOp (SegmentedHist name) = name
type ArrayName = (VName, [BodyType])

data BodyType
= SegOpName SegOpName
| LoopBodyName VName
| CondBodyName VName
deriving (Show, Ord, Eq)

-- | Each element in `dimensions` corresponds to an access to a given dimension
-- in the given array, in the same order of dimensions.
Expand Down Expand Up @@ -93,16 +93,6 @@ instance Monoid (DimIdxPat rep) where
data IterationType rep = Sequential | Parallel
deriving (Eq, Show)

data BodyType
= SegOpName SegOpName
| LoopBodyName LoopBodyName
| CondBodyName CondBodyName
deriving (Show, Ord, Eq)

type LoopBodyName = VName

type CondBodyName = VName

unionIndexTables :: IndexTable rep -> IndexTable rep -> IndexTable rep
unionIndexTables lhs rhs = do
M.unionWith (M.unionWith M.union) lhs rhs
Expand Down

0 comments on commit 6bbbf0d

Please sign in to comment.