diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-07-07 18:48:31 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-25 00:45:08 -0400 |
commit | 9dfeca6c2019fdb46613a68ccd6e650e40c7baac (patch) | |
tree | 29a2cda3faddedc7024be259011f4406b6473f45 /compiler/GHC/Driver/Pipeline.hs | |
parent | 6333d7391068d8029eed3e8eff019b9e2c104c7b (diff) | |
download | haskell-9dfeca6c2019fdb46613a68ccd6e650e40c7baac.tar.gz |
Remove platform constant wrappers
Platform constant wrappers took a DynFlags parameter, hence implicitly
used the target platform constants. We removed them to allow support
for several platforms at once (#14335) and to avoid having to pass
the full DynFlags to every function (#17957).
Metric Decrease:
T4801
Diffstat (limited to 'compiler/GHC/Driver/Pipeline.hs')
-rw-r--r-- | compiler/GHC/Driver/Pipeline.hs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index ccbd524e55..1603c38e71 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -894,16 +894,18 @@ llvmOptions dflags = | WayDyn `elem` ways dflags = "dynamic-no-pic" | otherwise = "static" + platform = targetPlatform dflags + align :: Int - align = case platformArch (targetPlatform dflags) of + align = case platformArch platform of ArchX86_64 | isAvxEnabled dflags -> 32 _ -> 0 attrs :: String attrs = intercalate "," $ mattr ++ ["+sse42" | isSse4_2Enabled dflags ] - ++ ["+sse2" | isSse2Enabled dflags ] - ++ ["+sse" | isSseEnabled dflags ] + ++ ["+sse2" | isSse2Enabled platform ] + ++ ["+sse" | isSseEnabled platform ] ++ ["+avx512f" | isAvx512fEnabled dflags ] ++ ["+avx2" | isAvx2Enabled dflags ] ++ ["+avx" | isAvxEnabled dflags ] @@ -1977,9 +1979,10 @@ doCpp dflags raw input_fn output_fn = do let cpp_prog args | raw = GHC.SysTools.runCpp dflags args | otherwise = GHC.SysTools.runCc Nothing dflags (GHC.SysTools.Option "-E" : args) - let targetArch = stringEncodeArch $ platformArch $ targetPlatform dflags - targetOS = stringEncodeOS $ platformOS $ targetPlatform dflags - isWindows = (platformOS $ targetPlatform dflags) == OSMinGW32 + let platform = targetPlatform dflags + targetArch = stringEncodeArch $ platformArch platform + targetOS = stringEncodeOS $ platformOS platform + isWindows = platformOS platform == OSMinGW32 let target_defs = [ "-D" ++ HOST_OS ++ "_BUILD_OS", "-D" ++ HOST_ARCH ++ "_BUILD_ARCH", @@ -1993,8 +1996,8 @@ doCpp dflags raw input_fn output_fn = do [ "-D__IO_MANAGER_MIO__=1" ] let sse_defs = - [ "-D__SSE__" | isSseEnabled dflags ] ++ - [ "-D__SSE2__" | isSse2Enabled dflags ] ++ + [ "-D__SSE__" | isSseEnabled platform ] ++ + [ "-D__SSE2__" | isSse2Enabled platform ] ++ [ "-D__SSE4_2__" | isSse4_2Enabled dflags ] let avx_defs = |