From 4d7bc8aa54a9622ba1487e05bc3851373b3160c0 Mon Sep 17 00:00:00 2001 From: Vidush Singhal Date: Mon, 2 Dec 2024 12:39:32 -0500 Subject: [PATCH] add a dyn flag to enable SoA --- gibbon-compiler/src/Gibbon/Compiler.hs | 1 + gibbon-compiler/src/Gibbon/DynFlags.hs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gibbon-compiler/src/Gibbon/Compiler.hs b/gibbon-compiler/src/Gibbon/Compiler.hs index 7a26220f2..e24877e9c 100644 --- a/gibbon-compiler/src/Gibbon/Compiler.hs +++ b/gibbon-compiler/src/Gibbon/Compiler.hs @@ -634,6 +634,7 @@ addRedirectionCon p@Prog{ddefs} = do passes :: (Show v) => Config -> L0.Prog0 -> StateT (CompileState v) IO L4.Prog passes config@Config{dynflags} l0 = do let isPacked = gopt Opt_Packed dynflags + isSoA = gopt Opt_Packed_SoA dynflags biginf = gopt Opt_BigInfiniteRegions dynflags gibbon1 = gopt Opt_Gibbon1 dynflags no_rcopies = gopt Opt_No_RemoveCopies dynflags diff --git a/gibbon-compiler/src/Gibbon/DynFlags.hs b/gibbon-compiler/src/Gibbon/DynFlags.hs index 31d709f45..07aa553e1 100644 --- a/gibbon-compiler/src/Gibbon/DynFlags.hs +++ b/gibbon-compiler/src/Gibbon/DynFlags.hs @@ -39,6 +39,7 @@ data GeneralFlag | Opt_GenGc -- ^ Use the new generational GC. | Opt_NoEagerPromote -- ^ Disable eager promotion. | Opt_SimpleWriteBarrier -- ^ Disables eliminate-indirection-chains optimization. + | Opt_Packed_SoA -- ^ Use packed representation but use a structure of arrays representation for the datatype deriving (Show,Read,Eq,Ord) -- | Exactly like GHC's ddump flags. @@ -114,9 +115,10 @@ dynflagsParser = DynFlags <$> (S.fromList <$> many gflagsParser) <*> (S.fromList flag' Opt_PrintGcStats (long "print-gc-stats" <> short 'S' <> help "Record and print GC statistics.") <|> flag' Opt_GenGc (long "gen-gc" <> help "Use the new generational GC.") <|> flag' Opt_NoEagerPromote (long "no-eager-promote" <> help "Disable eager promotion.") <|> - flag' Opt_SimpleWriteBarrier (long "simple-write-barrier" <> help "Disables eliminate-indirection-chains optimization.") - - + flag' Opt_SimpleWriteBarrier (long "simple-write-barrier" <> help "Disables eliminate-indirection-chains optimization.") <|> + flag' Opt_Packed_SoA (long "SoA" <> + help "Use a structure of arrays representation for all datatypes.") + dflagsParser :: Parser DebugFlag dflagsParser = flag' Opt_D_Dump_Repair (long "ddump-repair" <> help "Dump some information while running RepairProgram") <|>