[Git][ghc/ghc][master] 3 commits: compiler: fix eager blackhole symbol in wasm32 NCG

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sun Nov 5 04:25:00 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
fe50eb35 by Cheng Shao at 2023-11-05T00:24:20-04:00
compiler: fix eager blackhole symbol in wasm32 NCG

- - - - -
af771148 by Cheng Shao at 2023-11-05T00:24:20-04:00
testsuite: fix optasm tests for wasm32

- - - - -
1b90735c by Matthew Pickering at 2023-11-05T00:24:20-04:00
testsuite: Add wasm32 to testsuite arches with NCG

The compiler --info reports that wasm32 compilers have a NCG, so we
should agree with that here.

- - - - -


10 changed files:

- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- hadrian/src/Settings/Builders/RunTest.hs
- testsuite/tests/cmm/should_compile/all.T
- testsuite/tests/regalloc/all.T
- testsuite/tests/rts/T5644/all.T
- testsuite/tests/rts/all.T
- testsuite/tests/simplCore/prog003/simplCore.oneShot.stderr → testsuite/tests/simplCore/prog003/simplCore-oneShot.stderr
- testsuite/tests/simplCore/prog003/simplCore.oneShot.stdout → testsuite/tests/simplCore/prog003/simplCore-oneShot.stdout
- testsuite/tests/simplCore/prog003/test.T
- testsuite/tests/simplCore/should_run/all.T


Changes:

=====================================
compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
=====================================
@@ -883,7 +883,7 @@ lower_CmmReg lbl (CmmGlobal (GlobalRegUse greg reg_use_ty)) = do
       pure $
         SomeWasmExpr ty_word $
           WasmExpr $
-            WasmSymConst "stg_EAGER_BLACKHOLE_info"
+            WasmSymConst "__stg_EAGER_BLACKHOLE_info"
     GCEnter1 -> do
       onFuncSym "__stg_gc_enter_1" [] [ty_word_cmm]
       pure $ SomeWasmExpr ty_word $ WasmExpr $ WasmSymConst "__stg_gc_enter_1"


=====================================
hadrian/src/Settings/Builders/RunTest.hs
=====================================
@@ -118,7 +118,7 @@ inTreeCompilerArgs stg = do
 
     os          <- queryHostTarget queryOS
     arch        <- queryTargetTarget queryArch
-    let codegen_arches = ["x86_64", "i386", "powerpc", "powerpc64", "powerpc64le", "aarch64"]
+    let codegen_arches = ["x86_64", "i386", "powerpc", "powerpc64", "powerpc64le", "aarch64", "wasm32"]
     let withNativeCodeGen
           | unregisterised = False
           | arch `elem` codegen_arches = True


=====================================
testsuite/tests/cmm/should_compile/all.T
=====================================
@@ -3,7 +3,10 @@ setTestOpts(
   ])
 
 test('selfloop', [cmm_src], compile, ['-no-hs-main'])
-test('cmm_sink_sp', [ only_ways(['optasm']), grep_errmsg(r'(\[Sp.*\]).*(=).*(\[.*R1.*\]).*;',[1,2,3]), cmm_src], compile, ['-no-hs-main -ddump-cmm -dsuppress-uniques -O'])
+test('cmm_sink_sp', [ only_ways(['optasm']),
+                      when(arch('wasm32'), fragile(24152)),
+                      grep_errmsg(r'(\[Sp.*\]).*(=).*(\[.*R1.*\]).*;',[1,2,3]),
+                      cmm_src], compile, ['-no-hs-main -ddump-cmm -dsuppress-uniques -O'])
 
 test('T16930', normal, makefile_test, ['T16930'])
 test('T17442', normal, compile, [''])


=====================================
testsuite/tests/regalloc/all.T
=====================================
@@ -1,6 +1,8 @@
 test('regalloc_unit_tests',
      [ when(unregisterised(), skip), extra_files(['no_spills.cmm']),
        when(not have_ncg(), skip),
+       # no regalloc business on wasm32
+       when(arch('wasm32'), expect_fail),
        [ignore_stderr, only_ways(['normal'])], extra_run_opts('"' + config.libdir + '"') ],
      compile_and_run,
      ['-package ghc'])


=====================================
testsuite/tests/rts/T5644/all.T
=====================================
@@ -1,8 +1,9 @@
 test('T5644', [extra_files(['Conf.hs', 'ManyQueue.hs', 'Util.hs', 'heap-overflow.hs']),
-               
+
                 only_ways(['optasm','threaded1','threaded2']),
                 extra_run_opts('+RTS -M20m -RTS'),
-                exit_code(251) # RTS exit code for "out of memory"
+                exit_code(251), # RTS exit code for "out of memory"
+                when(arch('wasm32'), [ignore_stderr, exit_code(1)])
               ],
               multimod_compile_and_run,
               ['heap-overflow.hs','-O'])


=====================================
testsuite/tests/rts/all.T
=====================================
@@ -44,6 +44,8 @@ test('derefnull',
       when(opsys('mingw32'), [ignore_stderr, exit_code(11)]),
       when(opsys('mingw32'), [fragile(18548)]),
       when(arch('javascript'), [ignore_stderr, exit_code(1)]),
+      # On wasm32, 0x0 is a valid linear memory address
+      when(arch('wasm32'), [ignore_stdout, ignore_stderr, exit_code(0)]),
       # ThreadSanitizer changes the output
       when(have_thread_sanitizer(), skip),
       # since these test are supposed to crash the
@@ -82,6 +84,8 @@ test('divbyzero',
       when(platform('x86_64-apple-darwin'), [ignore_stderr, exit_code(136)]),
       # ThreadSanitizer changes the output
       when(have_thread_sanitizer(), skip),
+      # wasmtime returns sigabrt error code upon wasm traps
+      when(arch('wasm32'), [ignore_stdout, ignore_stderr, exit_code(134)]),
       # since these test are supposed to crash the
       # profile report will be empty always.
       # so disable the check for profiling


=====================================
testsuite/tests/simplCore/prog003/simplCore.oneShot.stderr → testsuite/tests/simplCore/prog003/simplCore-oneShot.stderr
=====================================


=====================================
testsuite/tests/simplCore/prog003/simplCore.oneShot.stdout → testsuite/tests/simplCore/prog003/simplCore-oneShot.stdout
=====================================


=====================================
testsuite/tests/simplCore/prog003/test.T
=====================================
@@ -1,3 +1,3 @@
-test('simplCore.oneShot', [extra_files(['OneShot1.hs', 'OneShot2.hs']),
+test('simplCore-oneShot', [extra_files(['OneShot1.hs', 'OneShot2.hs']),
                            only_ways(['optasm'])], multimod_compile_and_run,
      ['OneShot2', '-v0'])


=====================================
testsuite/tests/simplCore/should_run/all.T
=====================================
@@ -19,7 +19,8 @@ test('simplrun007', normal, compile_and_run, [''])
 test('simplrun008', normal, compile_and_run, [''])
 test('simplrun009', normal, compile_and_run, [''])
 test('simplrun010', [extra_run_opts('24 16 8 +RTS -M10m -RTS'),
-                     exit_code(251)]
+                     exit_code(251),
+                     when(arch('wasm32'), [ignore_stderr, exit_code(1)])]
                   , compile_and_run, [''])
 test('simplrun011', normal, compile_and_run, ['-fno-worker-wrapper'])
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e448f985331e02a0b7c16b25d000183068afc04...1b90735c99f1179328f6dd67dbcc81f964901a19

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e448f985331e02a0b7c16b25d000183068afc04...1b90735c99f1179328f6dd67dbcc81f964901a19
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/20231105/d47621a9/attachment-0001.html>


More information about the ghc-commits mailing list