Skip to content

Commit

Permalink
fix threadregions in a hacky way
Browse files Browse the repository at this point in the history
  • Loading branch information
vidsinghal committed Nov 14, 2024
1 parent 2c525ea commit a12ec8e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 61 deletions.
14 changes: 7 additions & 7 deletions gibbon-compiler/src/Gibbon/L3/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ data E3Ext loc dec =
-- ^ Do one of the following:
-- (1) If it's a old-to-young indirection, record it in the remembered set.
-- (2) Otherwise, bump the refcount and update the outset.
| BumpArenaRefCount Var Var -- ^ Given an arena and end-of-region ptr, add a
-- reference from the arena to the region
| NullCursor -- ^ Constant null cursor value (hack?).
-- Used for dict lookup, which returns a packed value but
-- no end witness.
| RetE [(PreExp E3Ext loc dec)] -- ^ Analogous to L2's RetE.
| GetCilkWorkerNum -- ^ Translates to __cilkrts_get_worker_number().
| BumpArenaRefCount Var Var -- ^ Given an arena and end-of-region ptr, add a
-- reference from the arena to the region
| NullCursor -- ^ Constant null cursor value (hack?).
-- Used for dict lookup, which returns a packed value but
-- no end witness.
| RetE [(PreExp E3Ext loc dec)] -- ^ Analogous to L2's RetE.
| GetCilkWorkerNum -- ^ Translates to __cilkrts_get_worker_number().
| LetAvail [Var] (PreExp E3Ext loc dec) -- ^ These variables are available to use before the join point
| AllocateTagHere Var TyCon -- ^ Analogous to L2's extension.
| AllocateScalarsHere Var -- ^ Analogous to L2's extension.
Expand Down
1 change: 0 additions & 1 deletion gibbon-compiler/src/Gibbon/Language.hs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ instance HasRenamable e l d => Renamable (PreExp e l d) where
instance Renamable a => Renamable (UrTy a) where
gRename env = fmap (gRename env)


--------------------------------------------------------------------------------
-- Helpers operating on expressions
--------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion gibbon-compiler/src/Gibbon/Language/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ data UrTy loc
class FreeVars a where
-- | Return a set of free TERM variables. Does not return location variables.
gFreeVars :: a -> S.Set Var
gFreeVars' :: a -> S.Set LocVar


-- | A generic interface to expressions found in different phases of
Expand Down Expand Up @@ -685,7 +686,7 @@ type HasSubstitutableExt e l d = ( Eq d, Show d, Out d, Eq l, Show l, Out l
-- has run before!
class Renamable e where
gRename :: M.Map Var Var -> e -> e

type HasRenamable e l d = (Renamable l, Renamable d, Renamable (e l d))

-- A convenience wrapper over some of the constraints.
Expand Down
Loading

0 comments on commit a12ec8e

Please sign in to comment.