[Git][ghc/ghc][wip/fendor/lazier-corebindings] 2 commits: Add performance regression test for '-fwrite-simplified-core'
Hannes Siebenhandl (@fendor)
gitlab at gitlab.haskell.org
Wed Apr 17 13:41:10 UTC 2024
Hannes Siebenhandl pushed to branch wip/fendor/lazier-corebindings at Glasgow Haskell Compiler / GHC
Commits:
49e49baa by Fendor at 2024-04-17T14:28:17+02:00
Add performance regression test for '-fwrite-simplified-core'
- - - - -
19763aca by Fendor at 2024-04-17T14:28:21+02:00
Typecheck corebindings lazily during bytecode generation
This delays typechecking the corebindings until the bytecode generation
happens.
- - - - -
3 changed files:
- compiler/GHC/Driver/Main.hs
- testsuite/tests/perf/compiler/Makefile
- testsuite/tests/perf/compiler/all.T
Changes:
=====================================
compiler/GHC/Driver/Main.hs
=====================================
@@ -990,16 +990,16 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = LM
types_var <- newIORef (md_types details)
let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)])
let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv }
- core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi
- -- MP: The NoStubs here is only from (I think) the TH `qAddForeignFilePath` feature but it's a bit unclear what to do
- -- with these files, do we have to read and serialise the foreign file? I will leave it for now until someone
- -- reports a bug.
- let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing []
-- The bytecode generation itself is lazy because otherwise even when doing
-- recompilation checking the bytecode will be generated (which slows things down a lot)
-- the laziness is OK because generateByteCode just depends on things already loaded
-- in the interface file.
LoadedBCOs <$> (unsafeInterleaveIO $ do
+ core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi
+ -- MP: The NoStubs here is only from (I think) the TH `qAddForeignFilePath` feature but it's a bit unclear what to do
+ -- with these files, do we have to read and serialise the foreign file? I will leave it for now until someone
+ -- reports a bug.
+ let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing []
trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod))
generateByteCode hsc_env cgi_guts (wcb_mod_location fi))
go ul = return ul
=====================================
testsuite/tests/perf/compiler/Makefile
=====================================
@@ -17,6 +17,10 @@ MultiModulesRecomp:
./genMultiLayerModules
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 MultiLayerModules.hs
+MultiModulesRecompDefsWithCore:
+ ./genMultiLayerModulesDefs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -fwrite-if-simplified-core -v0 MultiLayerModules.hs
+
MultiComponentModulesRecomp:
'$(PYTHON)' genMultiComp.py
TEST_HC='$(TEST_HC)' TEST_HC_OPTS='$(TEST_HC_OPTS)' ./run
=====================================
testsuite/tests/perf/compiler/all.T
=====================================
@@ -405,6 +405,20 @@ test('MultiLayerModulesDefsGhci',
ghci_script,
['MultiLayerModulesDefsGhci.script'])
+test('MultiLayerModulesDefsGhciWithCore',
+ [ collect_compiler_residency(15),
+ pre_cmd('$MAKE -s --no-print-directory MultiModulesRecompDefsWithCore'),
+ extra_files(['../../ghci/shell.hs', 'genMultiLayerModulesDefs', 'MultiLayerModulesDefsGhci.script']),
+ compile_timeout_multiplier(5),
+ # this is _a lot_
+ # but this test has been failing every now and then,
+ # especially on i386. Let's just give it some room
+ # to complete successfully reliably everywhere.
+ extra_run_opts('-fwrite-if-simplified-core')
+ ],
+ ghci_script,
+ ['MultiLayerModulesDefsGhci.script'])
+
test('MultiLayerModulesDefsGhciReload',
[ collect_compiler_residency(15),
pre_cmd('./genMultiLayerModulesDefs'),
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/125db4c4624aa0904a66253864b538eecf5d6f3f...19763aca6f2ae3246f741647180b690a52ebc32d
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/125db4c4624aa0904a66253864b538eecf5d6f3f...19763aca6f2ae3246f741647180b690a52ebc32d
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240417/28e6fe64/attachment-0001.html>
More information about the ghc-commits
mailing list