diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-08-08 17:43:12 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-26 16:00:33 -0500 |
commit | cdbd16f5450998ad27f376e97b11d3e2873b95f9 (patch) | |
tree | fe3a56763fdf534d641beb1b8c2c40da263ab38c /compiler/GHC/StgToCmm/Ticky.hs | |
parent | a84e53f978341135355c5c82cd7af2ae2efa5e72 (diff) | |
download | haskell-cdbd16f5450998ad27f376e97b11d3e2873b95f9.tar.gz |
Fix toArgRep to support 64-bit reps on all systems
[This is @Ericson2314 writing a commit message for @hsyl20's patch.]
(Progress towards #11953, #17377, #17375)
`Int64Rep` and `Word64Rep` are currently broken on 64-bit systems. This
is because they should use "native arg rep" but instead use "large arg
rep" as they do on 32-bit systems, which is either a non-concept or a
128-bit rep depending on one's vantage point.
Now, these reps currently aren't used during 64-bit compilation, so the
brokenness isn't observed, but I don't think that constitutes reasons
not to fix it. Firstly, the linked issues there is a clearly expressed
desire to use explicit-bitwidth constructs in more places. Secondly, per
[1], there are other bugs that *do* manifest from not threading
explicit-bitwidth information all the way through the compilation
pipeline. One can therefore view this as one piece of the larger effort
to do that, improve ergnomics, and squash remaining bugs.
Also, this is needed for !3658. I could just merge this as part of that,
but I'm keen on merging fixes "as they are ready" so the fixes that
aren't ready are isolated and easier to debug.
[1]: https://mail.haskell.org/pipermail/ghc-devs/2020-October/019332.html
Diffstat (limited to 'compiler/GHC/StgToCmm/Ticky.hs')
-rw-r--r-- | compiler/GHC/StgToCmm/Ticky.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs index b7f43665cd..44a99a0cae 100644 --- a/compiler/GHC/StgToCmm/Ticky.hs +++ b/compiler/GHC/StgToCmm/Ticky.hs @@ -409,10 +409,11 @@ tickySlowCall lf_info args = do tickySlowCallPat (map argPrimRep args) tickySlowCallPat :: [PrimRep] -> FCode () -tickySlowCallPat args = ifTicky $ - let argReps = map toArgRep args +tickySlowCallPat args = ifTicky $ do + platform <- profilePlatform <$> getProfile + let argReps = map (toArgRep platform) args (_, n_matched) = slowCallPattern argReps - in if n_matched > 0 && args `lengthIs` n_matched + if n_matched > 0 && args `lengthIs` n_matched then bumpTickyLbl $ mkRtsSlowFastTickyCtrLabel $ concatMap (map Data.Char.toLower . argRepString) argReps else bumpTickyCounter $ fsLit "VERY_SLOW_CALL_ctr" |