summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen
diff options
context:
space:
mode:
authordoyougnu <jeffrey.young@iohk.io>2022-01-04 13:22:50 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-01-31 18:46:11 -0500
commit60a54a8f3681869142b0967749a6999b22bad76a (patch)
tree920aa3a8343ef6f1a6f51bab385e9c2e20f2e57c /testsuite/tests/codeGen
parentee5c4f9d05fab41f53364dc18d30932034e6ada6 (diff)
downloadhaskell-60a54a8f3681869142b0967749a6999b22bad76a.tar.gz
StgToCmm: decouple DynFlags, add StgToCmmConfig
StgToCmm: add Config, remove CgInfoDownwards StgToCmm: runC api change to take StgToCmmConfig StgToCmm: CgInfoDownad -> StgToCmmConfig StgToCmm.Monad: update getters/setters/withers StgToCmm: remove CallOpts in StgToCmm.Closure StgToCmm: remove dynflag references StgToCmm: PtrOpts removed StgToCmm: add TMap to config, Prof - dynflags StgToCmm: add omit yields to config StgToCmm.ExtCode: remove redundant import StgToCmm.Heap: remove references to dynflags StgToCmm: codeGen api change, DynFlags -> Config StgToCmm: remove dynflags in Env and StgToCmm StgToCmm.DataCon: remove dynflags references StgToCmm: remove dynflag references in DataCon StgToCmm: add backend avx flags to config StgToCmm.Prim: remove dynflag references StgToCmm.Expr: remove dynflag references StgToCmm.Bind: remove references to dynflags StgToCmm: move DoAlignSanitisation to Cmm.Type StgToCmm: remove PtrOpts in Cmm.Parser.y DynFlags: update ipInitCode api StgToCmm: Config Module is single source of truth StgToCmm: Lazy config breaks IORef deadlock testsuite: bump countdeps threshold StgToCmm.Config: strictify fields except UpdFrame Strictifying UpdFrameOffset causes the RTS build with stage1 to deadlock. Additionally, before the deadlock performance of the RTS is noticeably slower. StgToCmm.Config: add field descriptions StgToCmm: revert strictify on Module in config testsuite: update CountDeps tests StgToCmm: update comment, fix exports Specifically update comment about loopification passed into dynflags then stored into stgToCmmConfig. And remove getDynFlags from Monad.hs exports Types.Name: add pprFullName function StgToCmm.Ticky: use pprFullname, fixup ExtCode imports Cmm.Info: revert cmmGetClosureType removal StgToCmm.Bind: use pprFullName, Config update comments StgToCmm: update closureDescription api StgToCmm: SAT altHeapCheck StgToCmm: default render for Info table, ticky Use default rendering contexts for info table and ticky ticky, which should be independent of command line input. testsuite: bump count deps pprFullName: flag for ticky vs normal style output convertInfoProvMap: remove unused parameter StgToCmm.Config: add backend flags to config StgToCmm.Config: remove Backend from Config StgToCmm.Prim: refactor Backend call sites StgToCmm.Prim: remove redundant imports StgToCmm.Config: refactor vec compatibility check StgToCmm.Config: add allowQuotRem2 flag StgToCmm.Ticky: print internal names with parens StgToCmm.Bind: dispatch ppr based on externality StgToCmm: Add pprTickyname, Fix ticky naming Accidently removed the ctx for ticky SDoc output. The only relevant flag is sdocPprDebug which was accidental set to False due to using defaultSDocContext without altering the flag. StgToCmm: remove stateful fields in config fixup: config: remove redundant imports StgToCmm: move Sequel type to its own module StgToCmm: proliferate getCallMethod updated api StgToCmm.Monad: add FCodeState to Monad Api StgToCmm: add second reader monad to FCode fixup: Prim.hs: missed a merge conflict fixup: Match countDeps tests to HEAD StgToCmm.Monad: withState -> withCgState To disambiguate it from mtl withState. This withState shouldn't be returning the new state as a value. However, fixing this means tackling the knot tying in CgState and so is very difficult since it changes when the thunk of the knot is forced which either leads to deadlock or to compiler panic.
Diffstat (limited to 'testsuite/tests/codeGen')
-rw-r--r--testsuite/tests/codeGen/should_compile/T13233_orig.hs32
1 files changed, 12 insertions, 20 deletions
diff --git a/testsuite/tests/codeGen/should_compile/T13233_orig.hs b/testsuite/tests/codeGen/should_compile/T13233_orig.hs
index e9447ec2c0..7539417911 100644
--- a/testsuite/tests/codeGen/should_compile/T13233_orig.hs
+++ b/testsuite/tests/codeGen/should_compile/T13233_orig.hs
@@ -5,29 +5,29 @@ module T13233_orig where
import Control.Monad ( ap, liftM )
-newtype FCode a = FCode (CgInfoDownwards -> CgState -> (# a, CgState #))
+newtype FCode a = FCode (StgToCmmConfig -> CgState -> (# a, CgState #))
-data CgInfoDownwards
- = MkCgInfoDown { cgd_dflags :: DynFlags }
+data StgToCmmConfig
+ = StgToCmmConfig { }
data CgState = MkCgState
returnFC :: a -> FCode a
-returnFC val = FCode (\_info_down state -> (# val, state #))
+returnFC val = FCode (\_cfg state -> (# val, state #))
thenC :: FCode () -> FCode a -> FCode a
thenC (FCode m) (FCode k) =
- FCode $ \ info_down state ->
- case m info_down state of
- (# _, new_state #) -> k info_down new_state
+ FCode $ \ cfg state ->
+ case m cfg state of
+ (# _, new_state #) -> k cfg new_state
thenFC :: FCode a -> (a -> FCode c) -> FCode c
thenFC (FCode m) k =
- FCode $ \ info_down state ->
- case m info_down state of
+ FCode $ \ cfg state ->
+ case m cfg state of
(# m_result, new_state #) ->
case k m_result of
- FCode kcode -> kcode info_down new_state
+ FCode kcode -> kcode cfg new_state
infixr 9 `thenC`
infixr 9 `thenFC`
@@ -46,13 +46,5 @@ instance Applicative FCode where
instance Monad FCode where
(>>=) = thenFC
-instance HasDynFlags FCode where
- getDynFlags = liftM cgd_dflags getInfoDown
-
-getInfoDown :: FCode CgInfoDownwards
-getInfoDown = FCode $ \ info_down state -> (# info_down, state #)
-
-class HasDynFlags m where
- getDynFlags :: m DynFlags
-
-data DynFlags = DynFlags
+getStgToCmmConfig :: FCode StgToCmmConfig
+getStgToCmmConfig = FCode $ \ cfg state -> (# cfg, state #)