Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
3ae875c4
Commit
3ae875c4
authored
Aug 02, 2012
by
Simon Marlow
Browse files
Eliminate "r = r" assignments.
Previously these were caught by removeDeadAssignments, but we aren't doing that now.
parent
95686360
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/cmm/CmmSink.hs
View file @
3ae875c4
...
...
@@ -205,7 +205,12 @@ walk nodes assigs = go nodes emptyBlock assigs
-- to get all the dead code, but it catches the common case of
-- superfluous reloads from the stack that the stack allocator
-- leaves behind.
--
-- Also we catch "r = r" here. You might think it would fall
-- out of inlining, but the inliner will see that r is live
-- after the instruction and choose not to inline r in the rhs.
discard
=
case
node
of
CmmAssign
r
(
CmmReg
r'
)
|
r
==
r'
->
True
CmmAssign
(
CmmLocal
r
)
_
->
not
(
r
`
Set
.
member
`
live
)
_otherwise
->
False
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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