summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmLive.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cmm/CmmLive.hs')
-rw-r--r--compiler/cmm/CmmLive.hs28
1 files changed, 0 insertions, 28 deletions
diff --git a/compiler/cmm/CmmLive.hs b/compiler/cmm/CmmLive.hs
index 7d674b76a2..e66ab73f8a 100644
--- a/compiler/cmm/CmmLive.hs
+++ b/compiler/cmm/CmmLive.hs
@@ -11,7 +11,6 @@ module CmmLive
, cmmGlobalLiveness
, liveLattice
, noLiveOnEntry, xferLive, gen, kill, gen_kill
- , removeDeadAssignments
)
where
@@ -98,30 +97,3 @@ xferLive dflags = mkBTransfer3 fst mid lst
mid n f = gen_kill dflags n f
lst :: CmmNode O C -> FactBase (CmmLive r) -> CmmLive r
lst n f = gen_kill dflags n $ joinOutFacts liveLattice n f
-
------------------------------------------------------------------------------
--- Removing assignments to dead variables
------------------------------------------------------------------------------
-
-removeDeadAssignments :: DynFlags -> CmmGraph
- -> UniqSM (CmmGraph, BlockEnv CmmLocalLive)
-removeDeadAssignments dflags g =
- dataflowPassBwd g [] $ analRewBwd liveLattice (xferLive dflags) rewrites
- where rewrites = mkBRewrite3 nothing middle nothing
- -- SDM: no need for deepBwdRw here, we only rewrite to empty
- -- Beware: deepBwdRw with one polymorphic function seems more
- -- reasonable here, but GHC panics while compiling, see bug
- -- #4045.
- middle :: CmmNode O O -> Fact O CmmLocalLive -> CmmReplGraph O O
- middle (CmmAssign (CmmLocal reg') _) live
- | not (reg' `elemRegSet` live)
- = return $ Just emptyGraph
- -- XXX maybe this should be somewhere else...
- middle (CmmAssign lhs (CmmReg rhs)) _ | lhs == rhs
- = return $ Just emptyGraph
- middle (CmmStore lhs (CmmLoad rhs _)) _ | lhs == rhs
- = return $ Just emptyGraph
- middle _ _ = return Nothing
-
- nothing :: CmmNode e x -> Fact x CmmLocalLive -> CmmReplGraph e x
- nothing _ _ = return Nothing