Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
vidsinghal committed Oct 8, 2024
1 parent 03bbf81 commit a6d1ffb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
37 changes: 0 additions & 37 deletions gibbon-compiler/src/Gibbon/Passes/InferLocations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,46 +152,9 @@ convertFunTy (from,to,isPar) = do
return $ LRM v (VarR r) md)
(F.toList ls)

-- convertFunTySoa :: ([Ty1],Ty1,Bool) -> DDefs Ty1 -> PassM (ArrowTy2 Ty2)
-- convertFunTySoa (from,to,isPar) ddefs = do
-- from' <- mapM convertTy from
-- from'' <- mapM (convertTySoA ddefs) from
-- to' <- convertTy to
-- to'' <- convertTySoA ddefs to
-- -- For this simple version, we assume every location is in a separate region:
-- lrm1 <- concat <$> mapM (toLRM Input) from'
-- lrm2 <- toLRM Output to'
-- dbgTraceIt "Print in Inferloc: " dbgTraceIt (sdoc (lrm1, lrm2, from, to, from', to', from'', to'')) dbgTraceIt "\n" return $ ArrowTy2 { locVars = lrm1 ++ lrm2
-- , arrIns = from'
-- , arrEffs = S.empty
-- , arrOut = to'
-- , locRets = []
-- , hasParallelism = isPar }
-- where
-- toLRM md ls =
-- mapM (\v -> do r <- freshLocVar "r"
-- return $ LRM v (VarR r) md)
-- (F.toList ls)


convertTy :: Ty1 -> PassM Ty2
convertTy ty = traverse (const (freshLocVar "loc")) ty

-- convertTySoA :: DDefs Ty1 -> Ty1 -> PassM Ty2SoA
-- convertTySoA ddefs ty = case ty of
-- PackedTy tc loc -> case (M.lookup (toVar tc) ddefs) of
-- Nothing -> do
-- loc <- freshLocVar "loc"
-- let locs = dbgTraceIt "Nothing case" [loc]
-- in traverse (const $ pure locs) ty
-- Just ddef -> do
-- loc <- freshLocVar "loc"
-- let locs = dbgTraceIt "just case" dbgTraceIt (sdoc ddef) dbgTraceIt "\n" [loc]
-- in traverse (const $ pure locs) ty


--traverse (const (freshLocVar "loc")) ty

convertDDefs :: DDefs Ty1 -> PassM (DDefs Ty2)
convertDDefs ddefs = traverse f ddefs
where f (DDef tyargs n dcs) = do
Expand Down
2 changes: 1 addition & 1 deletion gibbon-rts/rts-c/gibbon_rts.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ INLINE_HEADER void gib_grow_region(char **writeloc_addr, char **footer_addr)
if (old_chunk_in_nursery) {
gib_grow_region_in_nursery_fast(
false,
old_chunk_in_nursery,
old_chunk_in_nursery,
newsize,
old_footer,
writeloc_addr,
Expand Down

0 comments on commit a6d1ffb

Please sign in to comment.