summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/SPARC
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-07-19 10:03:06 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-07-30 11:55:17 +0100
commitf1ed6a1052331b6d5b001983925bdab66f99b0f6 (patch)
treed7c494a8e9bff22a5d91ca7765792a9ce13dac4a /compiler/nativeGen/SPARC
parentfe3753e75f2f140c6c2554e3e255d8f4c6f254be (diff)
downloadhaskell-f1ed6a1052331b6d5b001983925bdab66f99b0f6.tar.gz
New codegen: do not split proc-points when using the NCG
Proc-point splitting is only required by backends that do not support having proc-points within a code block (that is, everything except the native backend, i.e. LLVM and C). Not doing proc-point splitting saves some compilation time, and might produce slightly better code in some cases.
Diffstat (limited to 'compiler/nativeGen/SPARC')
-rw-r--r--compiler/nativeGen/SPARC/Ppr.hs72
1 files changed, 37 insertions, 35 deletions
diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs
index 91a2b894c5..8a5761990e 100644
--- a/compiler/nativeGen/SPARC/Ppr.hs
+++ b/compiler/nativeGen/SPARC/Ppr.hs
@@ -52,41 +52,43 @@ pprNatCmmDecl :: NatCmmDecl CmmStatics Instr -> SDoc
pprNatCmmDecl (CmmData section dats) =
pprSectionHeader section $$ pprDatas dats
- -- special case for split markers:
-pprNatCmmDecl (CmmProc Nothing lbl (ListGraph [])) = pprLabel lbl
-
- -- special case for code without info table:
-pprNatCmmDecl (CmmProc Nothing lbl (ListGraph blocks)) =
- pprSectionHeader Text $$
- pprLabel lbl $$ -- blocks guaranteed not null, so label needed
- vcat (map pprBasicBlock blocks)
-
-pprNatCmmDecl (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blocks)) =
- sdocWithPlatform $ \platform ->
- pprSectionHeader Text $$
- (
- (if platformHasSubsectionsViaSymbols platform
- then ppr (mkDeadStripPreventer info_lbl) <> char ':'
- else empty) $$
- vcat (map pprData info) $$
- pprLabel info_lbl
- ) $$
- vcat (map pprBasicBlock blocks) $$
- -- above: Even the first block gets a label, because with branch-chain
- -- elimination, it might be the target of a goto.
- (if platformHasSubsectionsViaSymbols platform
- then
- -- If we are using the .subsections_via_symbols directive
- -- (available on recent versions of Darwin),
- -- we have to make sure that there is some kind of reference
- -- from the entry code to a label on the _top_ of of the info table,
- -- so that the linker will not think it is unreferenced and dead-strip
- -- it. That's why the label is called a DeadStripPreventer (_dsp).
- text "\t.long "
- <+> ppr info_lbl
- <+> char '-'
- <+> ppr (mkDeadStripPreventer info_lbl)
- else empty)
+pprNatCmmDecl proc@(CmmProc _ lbl (ListGraph blocks)) =
+ case topInfoTable proc of
+ Nothing ->
+ case blocks of
+ [] -> -- special case for split markers:
+ pprLabel lbl
+ blocks -> -- special case for code without info table:
+ pprSectionHeader Text $$
+ pprLabel lbl $$ -- blocks guaranteed not null, so label needed
+ vcat (map pprBasicBlock blocks)
+
+ Just (Statics info_lbl info) ->
+ sdocWithPlatform $ \platform ->
+ pprSectionHeader Text $$
+ (
+ (if platformHasSubsectionsViaSymbols platform
+ then pprCLabel (mkDeadStripPreventer info_lbl) <> char ':'
+ else empty) $$
+ vcat (map pprData info) $$
+ pprLabel info_lbl
+ ) $$
+ vcat (map pprBasicBlock blocks) $$
+ -- above: Even the first block gets a label, because with branch-chain
+ -- elimination, it might be the target of a goto.
+ (if platformHasSubsectionsViaSymbols platform
+ then
+ -- If we are using the .subsections_via_symbols directive
+ -- (available on recent versions of Darwin),
+ -- we have to make sure that there is some kind of reference
+ -- from the entry code to a label on the _top_ of of the info table,
+ -- so that the linker will not think it is unreferenced and dead-strip
+ -- it. That's why the label is called a DeadStripPreventer (_dsp).
+ text "\t.long "
+ <+> pprCLabel info_lbl
+ <+> char '-'
+ <+> pprCLabel (mkDeadStripPreventer info_lbl)
+ else empty)
pprBasicBlock :: NatBasicBlock Instr -> SDoc