[Git][ghc/ghc][wip/supersven/ghc-master-riscv-ncg] 12 commits: Transform some StgRhsClosure into StgRhsCon after unarisation (#25166)

Sven Tennie (@supersven) gitlab at gitlab.haskell.org
Sun Sep 8 08:57:49 UTC 2024



Sven Tennie pushed to branch wip/supersven/ghc-master-riscv-ncg at Glasgow Haskell Compiler / GHC


Commits:
5456e02e by Sylvain Henry at 2024-09-06T11:57:01+02:00
Transform some StgRhsClosure into StgRhsCon after unarisation (#25166)

Before unarisation we may have code like:

  Test.foo :: Test.D
  [GblId, Unf=OtherCon []] =
      \u []
          case (# |_| #) [GHC.Types.(##)] of sat_sAw [Occ=Once1] {
          __DEFAULT -> Test.D [GHC.Types.True sat_sAw];
          };

After unarisation we get:

  Test.foo :: Test.D
  [GblId, Unf=OtherCon []] =
      {} \u [] Test.D [GHC.Types.True 2#];

Notice that it's still an Updatable closure for no reason anymore. This
patch transforms appropriate StgRhsClosures into StgRhsCons after
unarisation, allowing these closures to be statically allocated. Now we
get the expected:

  Test.foo :: Test.D
  [GblId, Unf=OtherCon []] =
      Test.D! [GHC.Types.True 2#];

Fix #25166

To avoid duplicating code, this patch refactors the mk(Top)StgRhs
functions and put them in a GHC.Stg.Make module alongside the new
mk(Top)StgRhsCon_maybe functions.

- - - - -
958b4518 by Hécate Kleidukos at 2024-09-06T16:40:56-04:00
haddock: Add missing requirements.txt for the online manual

- - - - -
af46239c by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: Add Native Code Generator (NCG)

This architecture wasn't supported before.

Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com>

- - - - -
9228d765 by Sven Tennie at 2024-09-08T08:57:47+00:00
Adjust test timings for slower computers

Increase the delays a bit to be able to run these tests on slower
computers.

The reference was a Lichee Pi 4a RISCV64 machine.

- - - - -
ba702986 by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: Add RTS linker

This architecture wasn't supported before.

Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com>

- - - - -
26e41e7b by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: Ignore divbyzero test

The architecture's behaviour differs from the test's expectations. See
comment in code why this is okay.

- - - - -
a41e9cdd by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: Enable MulMayOflo_full test

It works and thus can be tested.

- - - - -
fb4ee42b by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: LibffiAdjustor: Ensure code caches are flushed

RISCV64 needs a specific code flushing sequence (involving fence.i) when
new code is created/loaded.

- - - - -
09bdfc8e by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: Add additional linker symbols for builtins

We're relying on some GCC/Clang builtins. These need to be visible to
the linker (and not be stripped away.)

- - - - -
086806b2 by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: Add GHCi support

As we got a RTS linker for this architecture now, we can enable GHCi for
it.

- - - - -
606000eb by Sven Tennie at 2024-09-08T08:57:47+00:00
RISCV64: Set codeowners of the NCG

- - - - -
63feb19f by Sven Tennie at 2024-09-08T08:57:47+00:00
Add test for C calling convention

Ensure that parameters and return values are correctly processed. A
dedicated test (like this) helps to get the subtleties of calling
conventions easily right.

- - - - -


10 changed files:

- CODEOWNERS
- compiler/CodeGen.Platform.h
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/Dwarf/Constants.hs
- compiler/GHC/CmmToAsm/PIC.hs
- + compiler/GHC/CmmToAsm/RV64.hs
- + compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- + compiler/GHC/CmmToAsm/RV64/Cond.hs
- + compiler/GHC/CmmToAsm/RV64/Instr.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3149b4035c6b6422f28ee03a660e3b31cf85581f...63feb19ffef71c9dda93b4e8a1e2a6ccdba862cc

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3149b4035c6b6422f28ee03a660e3b31cf85581f...63feb19ffef71c9dda93b4e8a1e2a6ccdba862cc
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/20240908/2f0833c1/attachment.html>


More information about the ghc-commits mailing list