diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2019-10-20 02:30:01 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-23 05:59:04 -0400 |
commit | 6beea836094383eea96b15e526f31b5426aea630 (patch) | |
tree | eedb44be3fa4f86d085f3cfa2bb905b13cefccf4 /compiler/GHC | |
parent | 9c1f0f7c384eb2e38911b9a9b083ecda0970a060 (diff) | |
download | haskell-6beea836094383eea96b15e526f31b5426aea630.tar.gz |
Make dynflag argument for withTiming pure.
19 times out of 20 we already have dynflags in scope.
We could just always use `return dflags`. But this is in fact not free.
When looking at some STG code I noticed that we always allocate a
closure for this expression in the heap. Clearly a waste in these cases.
For the other cases we can either just modify the callsite to
get dynflags or use the _D variants of withTiming I added which
will use getDynFlags under the hood.
Diffstat (limited to 'compiler/GHC')
-rw-r--r-- | compiler/GHC/StgToCmm.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/StgToCmm.hs b/compiler/GHC/StgToCmm.hs index 96fa9e5cc1..f02d361fa4 100644 --- a/compiler/GHC/StgToCmm.hs +++ b/compiler/GHC/StgToCmm.hs @@ -71,7 +71,7 @@ codeGen dflags this_mod data_tycons ; cgref <- liftIO $ newIORef =<< initC ; let cg :: FCode () -> Stream IO CmmGroup () cg fcode = do - cmm <- liftIO . withTimingSilent (return dflags) (text "STG -> Cmm") (`seq` ()) $ do + cmm <- liftIO . withTimingSilent dflags (text "STG -> Cmm") (`seq` ()) $ do st <- readIORef cgref let (a,st') = runC dflags this_mod st (getCmm fcode) |