Skip to content

Commit

Permalink
Add new IR for location after an SoA location.
Browse files Browse the repository at this point in the history
  • Loading branch information
vidsinghal committed Dec 5, 2024
1 parent dc0f88e commit dca44a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions gibbon-compiler/src/Gibbon/L2/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ data PreLocExp loc = StartOfRegionLE Region
| FreeLE
| FromEndLE loc

| AfterVectorLE [PreLocExp loc]

| AfterSoALE (PreLocExp loc) [PreLocExp loc] loc -- Compute new SoA location from an old SoA location
-- (PreLocExp loc) -> expression for arithmetic on data constructor buffer
-- [PreLocExp loc] -> expressions for arithmetic on each field location
-- loc, store the old loc, why? -- capture more metadata, also style

deriving (Read, Show, Eq, Ord, Functor, Generic, NFData)

Expand Down
7 changes: 4 additions & 3 deletions gibbon-compiler/src/Gibbon/Passes/InferLocations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,16 @@ data Failure = FailUnify Ty2 Ty2
-- | Constraints here mean almost the same thing as they do in the L2 type checker.
-- One difference is the presence of an AfterTag constraint, though I'm not opposed to
-- adding one to the L2 language for symmetry.
-- [2024.12.04] VS
-- For AfterConstantL and AfterVariableL add a list argument with offsets for fields in an SoA location
-- Optional for AoS Location.
-- [05.12.2024]
-- VS: add AfterSoAL for a new location after an SoA location.
-- first contraint is for a data constructor buffer and list of constraints for the fields.
data Constraint = AfterConstantL LocVar Int LocVar
| AfterVariableL LocVar Var LocVar
| AfterTagL LocVar LocVar
| StartRegionL LocVar Region
| AfterCopyL LocVar Var Var LocVar Var [LocVar]
| FreeL LocVar
| AfterSoAL LocVar Constraint [Constraint] LocVar
deriving (Show, Eq, Generic)

instance Out Constraint
Expand Down

0 comments on commit dca44a6

Please sign in to comment.