Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,311
Issues
4,311
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
382
Merge Requests
382
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
ced4c754
Commit
ced4c754
authored
Sep 18, 2009
by
dias@cs.tufts.edu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More sensible use of -fnew-codegen and less debugging output
parent
df5b491c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
24 deletions
+21
-24
compiler/cmm/CmmBuildInfoTables.hs
compiler/cmm/CmmBuildInfoTables.hs
+6
-3
compiler/cmm/CmmCPSZ.hs
compiler/cmm/CmmCPSZ.hs
+10
-13
compiler/cmm/CmmSpillReload.hs
compiler/cmm/CmmSpillReload.hs
+1
-1
compiler/cmm/ZipDataflow.hs
compiler/cmm/ZipDataflow.hs
+2
-2
compiler/main/HscMain.lhs
compiler/main/HscMain.lhs
+2
-5
No files found.
compiler/cmm/CmmBuildInfoTables.hs
View file @
ced4c754
...
...
@@ -79,9 +79,12 @@ import ZipDataflow
-- which may differ depending on whether there is an update frame.
live_ptrs
::
ByteOff
->
BlockEnv
SubAreaSet
->
AreaMap
->
BlockId
->
[
Maybe
LocalReg
]
live_ptrs
oldByte
slotEnv
areaMap
bid
=
-- pprTrace "live_ptrs for" (ppr bid <+> ppr youngByte <+> ppr liveSlots) $
reverse
$
slotsToList
youngByte
liveSlots
[]
where
slotsToList
n
[]
results
|
n
==
oldByte
=
results
-- at old end of stack frame
-- pprTrace "live_ptrs for" (ppr bid <+> text (show oldByte ++ "-" ++ show youngByte) <+>
-- ppr liveSlots) $
-- pprTrace ("stack layout for " ++ show bid ++ ": ") (ppr res) $ res
res
where
res
=
reverse
$
slotsToList
youngByte
liveSlots
[]
slotsToList
n
[]
results
|
n
==
oldByte
=
results
-- at old end of stack frame
slotsToList
n
(
s
:
_
)
_
|
n
==
oldByte
=
pprPanic
"slot left off live_ptrs"
(
ppr
s
<+>
ppr
oldByte
<+>
ppr
n
<+>
ppr
liveSlots
<+>
ppr
youngByte
)
...
...
compiler/cmm/CmmCPSZ.hs
View file @
ced4c754
...
...
@@ -46,19 +46,16 @@ protoCmmCPSZ :: HscEnv -- Compilation env including
->
(
TopSRT
,
[
CmmZ
])
-- SRT table and accumulating list of compiled procs
->
CmmZ
-- Input C-- with Procedures
->
IO
(
TopSRT
,
[
CmmZ
])
-- Output CPS transformed C--
protoCmmCPSZ
hsc_env
(
topSRT
,
rst
)
(
Cmm
tops
)
|
not
(
dopt
Opt_TryNewCodeGen
(
hsc_dflags
hsc_env
))
=
return
(
topSRT
,
Cmm
tops
:
rst
)
-- Only if -fnew-codegen
|
otherwise
=
do
let
dflags
=
hsc_dflags
hsc_env
showPass
dflags
"CPSZ"
(
cafEnvs
,
tops
)
<-
liftM
unzip
$
mapM
(
cpsTop
hsc_env
)
tops
let
topCAFEnv
=
mkTopCAFInfo
(
concat
cafEnvs
)
(
topSRT
,
tops
)
<-
foldM
(
toTops
hsc_env
topCAFEnv
)
(
topSRT
,
[]
)
tops
-- (topSRT, tops) <- foldM (\ z f -> f topCAFEnv z) (topSRT, []) toTops
let
cmms
=
Cmm
(
reverse
(
concat
tops
))
dumpIfSet_dyn
dflags
Opt_D_dump_cps_cmm
"Post CPS Cmm"
(
ppr
cmms
)
return
(
topSRT
,
cmms
:
rst
)
protoCmmCPSZ
hsc_env
(
topSRT
,
rst
)
(
Cmm
tops
)
=
do
let
dflags
=
hsc_dflags
hsc_env
showPass
dflags
"CPSZ"
(
cafEnvs
,
tops
)
<-
liftM
unzip
$
mapM
(
cpsTop
hsc_env
)
tops
let
topCAFEnv
=
mkTopCAFInfo
(
concat
cafEnvs
)
(
topSRT
,
tops
)
<-
foldM
(
toTops
hsc_env
topCAFEnv
)
(
topSRT
,
[]
)
tops
-- (topSRT, tops) <- foldM (\ z f -> f topCAFEnv z) (topSRT, []) toTops
let
cmms
=
Cmm
(
reverse
(
concat
tops
))
dumpIfSet_dyn
dflags
Opt_D_dump_cps_cmm
"Post CPS Cmm"
(
ppr
cmms
)
return
(
topSRT
,
cmms
:
rst
)
{- [Note global fuel]
~~~~~~~~~~~~~~~~~~~~~
...
...
compiler/cmm/CmmSpillReload.hs
View file @
ced4c754
...
...
@@ -64,7 +64,7 @@ changeRegs f live = live { in_regs = f (in_regs live) }
dualLiveLattice
::
DataflowLattice
DualLive
dualLiveLattice
=
DataflowLattice
"variables live in registers and on stack"
empty
add
Tru
e
DataflowLattice
"variables live in registers and on stack"
empty
add
Fals
e
where
empty
=
DualLive
emptyRegSet
emptyRegSet
-- | compute in the Tx monad to track whether anything has changed
add
new
old
=
do
stack
<-
add1
(
on_stack
new
)
(
on_stack
old
)
...
...
compiler/cmm/ZipDataflow.hs
View file @
ced4c754
...
...
@@ -570,7 +570,7 @@ mk_set_or_save :: (DataflowAnalysis df, Monad (df a), Outputable a) =>
(
BlockId
->
Bool
)
->
LastOutFacts
a
->
df
a
()
mk_set_or_save
is_local
(
LastOutFacts
l
)
=
mapM_
set_or_save_one
l
where
set_or_save_one
(
id
,
a
)
=
if
is_local
id
then
setFact
id
a
else
pprTrace
"addLastOutFact"
(
ppr
$
length
l
)
$
addLastOutFact
(
id
,
a
)
if
is_local
id
then
setFact
id
a
else
addLastOutFact
(
id
,
a
)
...
...
@@ -980,7 +980,7 @@ instance FixedPoint ForwardFixedPoint where
dump_things
::
Bool
dump_things
=
Tru
e
dump_things
=
Fals
e
my_trace
::
String
->
SDoc
->
a
->
a
my_trace
=
if
dump_things
then
pprTrace
else
\
_
_
a
->
a
...
...
compiler/main/HscMain.lhs
View file @
ced4c754
...
...
@@ -789,11 +789,8 @@ tryNewCodeGen :: HscEnv -> Module -> [TyCon] -> [Module]
-> HpcInfo
-> IO [Cmm]
tryNewCodeGen hsc_env this_mod data_tycons imported_mods
cost_centre_info stg_binds hpc_info
| not (dopt Opt_TryNewCodeGen (hsc_dflags hsc_env))
= return []
| otherwise
= do { let dflags = hsc_dflags hsc_env
cost_centre_info stg_binds hpc_info =
do { let dflags = hsc_dflags hsc_env
; prog <- StgCmm.codeGen dflags this_mod data_tycons imported_mods
cost_centre_info stg_binds hpc_info
; dumpIfSet_dyn dflags Opt_D_dump_cmmz "Cmm produced by new codegen"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment