summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-02-16 15:05:06 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-02-16 15:05:06 +0000
commit6e9501c0e3c3bb807981c0378c969d0667a7ce0b (patch)
treec1e9880020163d25e18ed0316ae9a0bf63a3aecc /compiler/codeGen
parentcd81cd88f2e6f7972221bf2f6d956a0a63ac2e84 (diff)
downloadhaskell-6e9501c0e3c3bb807981c0378c969d0667a7ce0b.tar.gz
Beef up cmmMiniInline a tiny bit
Allow a temporary assignment to be pushed past an assignment to a global if the global is not mentioned in the rhs of the assignment we are inlining. This fixes up some bad code. We should make sure we're doing something equivalent in the new backend in due course.
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/CgUtils.hs7
-rw-r--r--compiler/codeGen/StgCmmUtils.hs3
2 files changed, 1 insertions, 9 deletions
diff --git a/compiler/codeGen/CgUtils.hs b/compiler/codeGen/CgUtils.hs
index 8ce1ffc0b4..f8b41a087a 100644
--- a/compiler/codeGen/CgUtils.hs
+++ b/compiler/codeGen/CgUtils.hs
@@ -945,13 +945,6 @@ anySrc p (CmmComment _) = False
anySrc p CmmNop = False
anySrc p other = True -- Conservative
-regUsedIn :: CmmReg -> CmmExpr -> Bool
-reg `regUsedIn` CmmLit _ = False
-reg `regUsedIn` CmmLoad e _ = reg `regUsedIn` e
-reg `regUsedIn` CmmReg reg' = reg == reg'
-reg `regUsedIn` CmmRegOff reg' _ = reg == reg'
-reg `regUsedIn` CmmMachOp _ es = any (reg `regUsedIn`) es
-
locUsedIn :: CmmExpr -> CmmType -> CmmExpr -> Bool
-- (locUsedIn a r e) checks whether writing to r[a] could affect the value of
-- 'e'. Returns True if it's not sure.
diff --git a/compiler/codeGen/StgCmmUtils.hs b/compiler/codeGen/StgCmmUtils.hs
index 9cfb241d1e..4b1446a7e2 100644
--- a/compiler/codeGen/StgCmmUtils.hs
+++ b/compiler/codeGen/StgCmmUtils.hs
@@ -49,7 +49,7 @@ module StgCmmUtils (
import StgCmmMonad
import StgCmmClosure
import BlockId
-import Cmm
+import Cmm hiding (regUsedIn)
import MkZipCfgCmm
import CLabel
import CmmUtils
@@ -596,7 +596,6 @@ reg `regUsedIn` CmmRegOff (CmmLocal reg') _ = reg == reg'
reg `regUsedIn` CmmMachOp _ es = any (reg `regUsedIn`) es
_reg `regUsedIn` _other = False -- The CmmGlobal cases
-
-------------------------------------------------------------------------
-- mkSwitch
-------------------------------------------------------------------------