diff options
author | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2014-02-01 19:15:06 +0100 |
---|---|---|
committer | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2014-02-01 19:15:06 +0100 |
commit | 78afa2078e474c9e8fd3d0f347c5652f296d5248 (patch) | |
tree | 701d37ac7a4edfac628fcb676ef81489abfd781a /compiler/cmm/CmmLive.hs | |
parent | 99c3ed81ac53629771b00a0abbe37c989ea45cd6 (diff) | |
download | haskell-78afa2078e474c9e8fd3d0f347c5652f296d5248.tar.gz |
Nuke dead code
* CmmRewriteAddignments module was replaced by CmmSink a long
time ago. That module is now available at
https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Hoopl/Examples
wiki page.
* removeDeadAssignments function was not used and it was also
moved to the above page.
* I also nuked some commented out debugging code that was not
used for 1,5 year.
Diffstat (limited to 'compiler/cmm/CmmLive.hs')
-rw-r--r-- | compiler/cmm/CmmLive.hs | 28 |
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 |