Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
9a740fb9
Commit
9a740fb9
authored
May 23, 2007
by
Michael D. Adams
Browse files
Removed an older version of selectStackFormat
parent
53a82428
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/cmm/CmmCPS.hs
View file @
9a740fb9
...
...
@@ -242,58 +242,6 @@ buildContinuation proc_points blocks start =
--------------------------------------------------------------------------------
-- For now just select the continuation orders in the order they are in the set with no gaps
selectStackFormat
::
BlockEnv
CmmLive
->
[
BrokenBlock
]
->
BlockEnv
StackFormat
selectStackFormat
live
blocks
=
fixedpoint
dependants
update
(
map
brokenBlockId
blocks
)
emptyUFM
where
blocks_ufm
::
BlockEnv
BrokenBlock
blocks_ufm
=
listToUFM
$
map
(
\
b
->
(
brokenBlockId
b
,
b
))
blocks
dependants
::
BlockId
->
[
BlockId
]
dependants
ident
=
brokenBlockTargets
$
lookupWithDefaultUFM
blocks_ufm
unknown_block
ident
update
::
BlockId
->
Maybe
BlockId
->
BlockEnv
StackFormat
->
Maybe
(
BlockEnv
StackFormat
)
update
ident
cause
formats
=
if
ident
`
elemUFM
`
formats
then
Nothing
-- Blocks only need to be updated once
else
case
(
cause
,
brokenBlockEntry
$
lookupWithDefaultUFM
blocks_ufm
unknown_block
ident
)
of
-- Propagate only to blocks entered by branches
-- (not function entry blocks or continuation entry blocks)
(
Just
cause_name
,
ControlEntry
)
->
Just
$
addToUFM
formats
ident
cause_format
where
cause_format
=
lookupWithDefaultUFM
formats
unknown_block
cause_name
-- Do initial calculates for function blocks
(
Nothing
,
FunctionEntry
_
_
)
->
Just
$
addToUFM
formats
ident
$
StackFormat
ident
0
[]
-- Do initial calculates for continuation blocks
(
Nothing
,
ContinuationEntry
_
)
->
Just
$
addToUFM
formats
ident
$
live_to_format
ident
$
lookupWithDefaultUFM
live
unknown_block
ident
_
->
Nothing
unknown_block
=
panic
"unknown BlockId in selectStackFormat"
live_to_format
::
BlockId
->
CmmLive
->
StackFormat
live_to_format
label
live
=
foldl
extend_format
(
StackFormat
label
retAddrSizeW
[]
)
(
uniqSetToList
live
)
extend_format
::
StackFormat
->
LocalReg
->
StackFormat
extend_format
(
StackFormat
block
size
offsets
)
reg
=
StackFormat
block
(
slot_size
reg
+
size
)
((
CmmLocal
reg
,
size
)
:
offsets
)
selectStackFormat2
::
BlockEnv
CmmLive
->
[
Continuation
]
->
[(
CLabel
,
StackFormat
)]
selectStackFormat2
live
continuations
=
map
(
\
c
->
(
continuationLabel
c
,
selectStackFormat'
c
))
continuations
...
...
Write
Preview
Supports
Markdown
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