diff options
author | doyougnu <jeffrey.young@iohk.io> | 2022-02-16 10:15:40 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-02 01:15:39 -0500 |
commit | aeea6bd588060108dea88996c19f48b9e50adad2 (patch) | |
tree | 553263aa12727ec4ffb49ca3425dc96dcaf65be9 /compiler/GHC/StgToCmm | |
parent | 75caafaafca5a1941c276f95017c34f68da8d679 (diff) | |
download | haskell-aeea6bd588060108dea88996c19f48b9e50adad2.tar.gz |
StgToCmm.cgTopBinding: no isNCG, use binBlobThresh
This is a one line change. It is a fixup from MR!7325, was pointed out
in review of MR!7442, specifically: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7442#note_406581
The change removes isNCG check from cgTopBinding. Instead it changes the
type of binBlobThresh in DynFlags from Word to Maybe Word, where a Just
0 or a Nothing indicates an infinite threshold and thus the disable
CmmFileEmbed case in the original check.
This improves the cohesion of the module because more NCG related
Backend stuff is moved into, and checked in, StgToCmm.Config. Note, that
the meaning of a Just 0 or a Nothing in binBlobThresh is indicated in a
comment next to its field in GHC.StgToCmm.Config.
DynFlags: binBlobThresh: Word -> Maybe Word
StgToCmm.Config: binBlobThesh add not ncg check
DynFlags.binBlob: move Just 0 check to dflags init
StgToCmm.binBlob: only check isNCG, Just 0 check to dflags
StgToCmm.Config: strictify binBlobThresh
Diffstat (limited to 'compiler/GHC/StgToCmm')
-rw-r--r-- | compiler/GHC/StgToCmm/Config.hs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/GHC/StgToCmm/Config.hs b/compiler/GHC/StgToCmm/Config.hs index b3014fd302..d73dd753e6 100644 --- a/compiler/GHC/StgToCmm/Config.hs +++ b/compiler/GHC/StgToCmm/Config.hs @@ -23,9 +23,15 @@ data StgToCmmConfig = StgToCmmConfig , stgToCmmTmpDir :: !TempDir -- ^ Temp Dir for files used in compilation , stgToCmmContext :: !SDocContext -- ^ Context for StgToCmm phase , stgToCmmDebugLevel :: !Int -- ^ The verbosity of debug messages - , stgToCmmBinBlobThresh :: !Word -- ^ Binary literals (e.g. strings) whose size is above this - -- threshold will be dumped in a binary file by the assembler - -- code generator (0 to disable) + , stgToCmmBinBlobThresh :: !(Maybe Word) -- ^ Threshold at which Binary literals (e.g. strings) + -- are either dumped to a file and a CmmFileEmbed literal + -- is emitted (over threshold), or become a CmmString + -- Literal (under or at threshold). CmmFileEmbed is only supported + -- with the NCG, thus a Just means two things: We have a threshold, + -- and will be using the NCG. Conversely, a Nothing implies we are not + -- using NCG and disables CmmFileEmbed. See Note + -- [Embedding large binary blobs] in GHC.CmmToAsm.Ppr, and + -- @cgTopBinding@ in GHC.StgToCmm. , stgToCmmMaxInlAllocSize :: !Int -- ^ Max size, in bytes, of inline array allocations. ------------------------------ Ticky Options ---------------------------------- , stgToCmmDoTicky :: !Bool -- ^ Ticky profiling enabled (cf @-ticky@) |