Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
c5883957
Commit
c5883957
authored
Oct 25, 2012
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug in CmmSink exposed by a recent optimisation (
#7366
)
parent
467e1a62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
compiler/cmm/CmmSink.hs
compiler/cmm/CmmSink.hs
+10
-0
No files found.
compiler/cmm/CmmSink.hs
View file @
c5883957
...
...
@@ -384,6 +384,7 @@ tryToInline dflags live node assigs = go usages node [] assigs
-- usages of the regs on the RHS to 2.
cannot_inline
=
skipped
`
regsUsedIn
`
rhs
-- Note [dependent assignments]
||
l
`
elem
`
skipped
||
not
(
okToInline
dflags
rhs
node
)
occurs_once
=
not
(
l
`
elemRegSet
`
live
)
...
...
@@ -415,6 +416,15 @@ tryToInline dflags live node assigs = go usages node [] assigs
--
-- For now we do nothing, because this would require putting
-- everything inside UniqSM.
--
-- One more variant of this (#7366):
--
-- [ y = e, y = z ]
--
-- If we don't want to inline y = e, because y is used many times, we
-- might still be tempted to inline y = z (because we always inline
-- trivial rhs's). But of course we can't, because y is equal to e,
-- not z.
addUsage
::
UniqFM
Int
->
LocalReg
->
UniqFM
Int
addUsage
m
r
=
addToUFM_C
(
+
)
m
r
1
...
...
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