diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-10-13 19:47:27 -0500 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-10-24 22:41:23 +0200 |
commit | 0c0cdcacd64860e3a5ae1b876734b4743c7b9252 (patch) | |
tree | 41e37bc947d1ca2fea62220842574d1088800dbb /compiler/GHC/CmmToAsm/AArch64.hs | |
parent | 8d2dbe2db4cc7c8b6d39b1ea64b0508304a3273c (diff) | |
download | haskell-wip/efficient-codegen.tar.gz |
Use a more efficient printer for code generation (#21853)wip/efficient-codegen
The changes in `GHC.Utils.Outputable` are the bulk of the patch
and drive the rest.
The types `HLine` and `HDoc` in Outputable can be used instead of `SDoc`
and support printing directly to a handle with `bPutHDoc`.
See Note [SDoc versus HDoc] and Note [HLine versus HDoc].
The classes `IsLine` and `IsDoc` are used to make the existing code polymorphic
over `HLine`/`HDoc` and `SDoc`. This is done for X86, PPC, AArch64, DWARF
and dependencies (printing module names, labels etc.).
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
Metric Decrease:
CoOpt_Read
ManyAlternatives
ManyConstructors
T10421
T12425
T12707
T13035
T13056
T13253
T13379
T18140
T18282
T18698a
T18698b
T1969
T20049
T21839c
T21839r
T3064
T3294
T4801
T5321FD
T5321Fun
T5631
T6048
T783
T9198
T9233
Diffstat (limited to 'compiler/GHC/CmmToAsm/AArch64.hs')
-rw-r--r-- | compiler/GHC/CmmToAsm/AArch64.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/CmmToAsm/AArch64.hs b/compiler/GHC/CmmToAsm/AArch64.hs index 8b85b12ff6..d814764b2d 100644 --- a/compiler/GHC/CmmToAsm/AArch64.hs +++ b/compiler/GHC/CmmToAsm/AArch64.hs @@ -11,6 +11,7 @@ import GHC.CmmToAsm.Instr import GHC.CmmToAsm.Monad import GHC.CmmToAsm.Config import GHC.CmmToAsm.Types +import GHC.Utils.Outputable (ftext) import qualified GHC.CmmToAsm.AArch64.Instr as AArch64 import qualified GHC.CmmToAsm.AArch64.Ppr as AArch64 @@ -28,7 +29,8 @@ ncgAArch64 config ,canShortcut = AArch64.canShortcut ,shortcutStatics = AArch64.shortcutStatics ,shortcutJump = AArch64.shortcutJump - ,pprNatCmmDecl = AArch64.pprNatCmmDecl config + ,pprNatCmmDeclS = AArch64.pprNatCmmDecl config + ,pprNatCmmDeclH = AArch64.pprNatCmmDecl config ,maxSpillSlots = AArch64.maxSpillSlots config ,allocatableRegs = AArch64.allocatableRegs platform ,ncgAllocMoreStack = AArch64.allocMoreStack platform @@ -55,5 +57,5 @@ instance Instruction AArch64.Instr where mkJumpInstr = AArch64.mkJumpInstr mkStackAllocInstr = AArch64.mkStackAllocInstr mkStackDeallocInstr = AArch64.mkStackDeallocInstr - mkComment = pure . AArch64.COMMENT + mkComment = pure . AArch64.COMMENT . ftext pprInstr = AArch64.pprInstr |