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/Driver/Config | |
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/Driver/Config')
-rw-r--r-- | compiler/GHC/Driver/Config/StgToCmm.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Driver/Config/StgToCmm.hs b/compiler/GHC/Driver/Config/StgToCmm.hs index 9896fed3bc..1b05884bb7 100644 --- a/compiler/GHC/Driver/Config/StgToCmm.hs +++ b/compiler/GHC/Driver/Config/StgToCmm.hs @@ -22,7 +22,7 @@ initStgToCmmConfig dflags mod = StgToCmmConfig , stgToCmmTmpDir = tmpDir dflags , stgToCmmContext = initSDocContext dflags defaultDumpStyle , stgToCmmDebugLevel = debugLevel dflags - , stgToCmmBinBlobThresh = binBlobThreshold dflags + , stgToCmmBinBlobThresh = b_blob , stgToCmmMaxInlAllocSize = maxInlineAllocSize dflags -- ticky options , stgToCmmDoTicky = gopt Opt_Ticky dflags @@ -63,6 +63,7 @@ initStgToCmmConfig dflags mod = StgToCmmConfig bk_end = backend dflags ncg = bk_end == NCG llvm = bk_end == LLVM + b_blob = if not ncg then Nothing else binBlobThreshold dflags x86ish = case platformArch platform of ArchX86 -> True ArchX86_64 -> True |