[commit: ghc] master: 80 columns (81610b0)
git at git.haskell.org
git at git.haskell.org
Sat Sep 14 22:00:03 CEST 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/81610b0ecbd718590b7b9afa749fc8b81633d6fc/ghc
>---------------------------------------------------------------
commit 81610b0ecbd718590b7b9afa749fc8b81633d6fc
Author: Simon Marlow <marlowsd at gmail.com>
Date: Sat Sep 14 19:52:36 2013 +0100
80 columns
>---------------------------------------------------------------
81610b0ecbd718590b7b9afa749fc8b81633d6fc
compiler/cmm/CmmSink.hs | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/compiler/cmm/CmmSink.hs b/compiler/cmm/CmmSink.hs
index 7b5aaa6..616d4da 100644
--- a/compiler/cmm/CmmSink.hs
+++ b/compiler/cmm/CmmSink.hs
@@ -305,7 +305,8 @@ walk dflags nodes assigs = go nodes emptyBlock assigs
where
go [] block as = (block, as)
go ((live,node):ns) block as
- | shouldDiscard node live = go ns block as -- discard dead assignment
+ | shouldDiscard node live = go ns block as
+ -- discard dead assignment
| Just a <- shouldSink dflags node2 = go ns block (a : as1)
| otherwise = go ns block' as'
where
@@ -410,12 +411,13 @@ tryToInline dflags live node assigs = go usages node [] assigs
inline_and_discard = go usages' inl_node skipped rest
where usages' = foldLocalRegsUsed dflags addUsage usages rhs
- dont_inline = keep node -- don't inline the assignment, keep it
- inline_and_keep = keep inl_node -- inline the assignment, keep it
+ dont_inline = keep node -- don't inline the assignment, keep it
+ inline_and_keep = keep inl_node -- inline the assignment, keep it
keep node' = (final_node, a : rest')
where (final_node, rest') = go usages' node' (l:skipped) rest
- usages' = foldLocalRegsUsed dflags (\m r -> addToUFM m r 2) usages rhs
+ usages' = foldLocalRegsUsed dflags (\m r -> addToUFM m r 2)
+ usages rhs
-- we must not inline anything that is mentioned in the RHS
-- of a binding that we have already skipped, so we set the
-- usages of the regs on the RHS to 2.
@@ -427,7 +429,8 @@ tryToInline dflags live node assigs = go usages node [] assigs
occurs_once = not (l `elemRegSet` live)
&& lookupUFM usages l == Just 1
- inl_node = mapExpDeep inline node -- mapExpDeep is where the inlining actually takes place!
+ inl_node = mapExpDeep inline node
+ -- mapExpDeep is where the inlining actually takes place!
where inline (CmmReg (CmmLocal l')) | l == l' = rhs
inline (CmmRegOff (CmmLocal l') off) | l == l'
= cmmOffset dflags rhs off
More information about the ghc-commits
mailing list