From dca44a6cd4e7917fbbfb0e08a9d1801ccc5c1fc6 Mon Sep 17 00:00:00 2001 From: Vidush Singhal Date: Thu, 5 Dec 2024 14:05:47 -0500 Subject: [PATCH] Add new IR for location after an SoA location. --- gibbon-compiler/src/Gibbon/L2/Syntax.hs | 6 ++++-- gibbon-compiler/src/Gibbon/Passes/InferLocations.hs | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gibbon-compiler/src/Gibbon/L2/Syntax.hs b/gibbon-compiler/src/Gibbon/L2/Syntax.hs index 2c4e678f..5ae3d2ee 100644 --- a/gibbon-compiler/src/Gibbon/L2/Syntax.hs +++ b/gibbon-compiler/src/Gibbon/L2/Syntax.hs @@ -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) diff --git a/gibbon-compiler/src/Gibbon/Passes/InferLocations.hs b/gibbon-compiler/src/Gibbon/Passes/InferLocations.hs index 61fdb772..2977c502 100644 --- a/gibbon-compiler/src/Gibbon/Passes/InferLocations.hs +++ b/gibbon-compiler/src/Gibbon/Passes/InferLocations.hs @@ -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