[commit: ghc] master: Remove unused code (a05ffbd)

git at git.haskell.org git at git.haskell.org
Wed Oct 16 11:16:14 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a05ffbd9ae09a22e6ab08b14a111988cf6846590/ghc

>---------------------------------------------------------------

commit a05ffbd9ae09a22e6ab08b14a111988cf6846590
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date:   Wed Oct 16 13:12:12 2013 +0200

    Remove unused code
    
    I am removing old loopification code that has been commented out
    for long long time. We now have loopification implemented in
    the code generator (see Note [Self-recursive tail calls]) so we
    won't need to resurect this old code.


>---------------------------------------------------------------

a05ffbd9ae09a22e6ab08b14a111988cf6846590
 compiler/cmm/CmmOpt.hs |   48 ------------------------------------------------
 1 file changed, 48 deletions(-)

diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs
index 359d44b..acaed28 100644
--- a/compiler/cmm/CmmOpt.hs
+++ b/compiler/cmm/CmmOpt.hs
@@ -387,54 +387,6 @@ exactLog2 x_
     pow2 x | x ==# _ILIT(1) = _ILIT(0)
            | otherwise = _ILIT(1) +# pow2 (x `shiftR_FastInt` _ILIT(1))
 
-
--- -----------------------------------------------------------------------------
--- Loopify for C
-
-{-
- This is a simple pass that replaces tail-recursive functions like this:
-
-   fac() {
-     ...
-     jump fac();
-   }
-
- with this:
-
-  fac() {
-   L:
-     ...
-     goto L;
-  }
-
-  the latter generates better C code, because the C compiler treats it
-  like a loop, and brings full loop optimisation to bear.
-
-  In my measurements this makes little or no difference to anything
-  except factorial, but what the hell.
--}
-
-{-
-cmmLoopifyForC :: DynFlags -> RawCmmDecl -> RawCmmDecl
--- XXX: revisit if we actually want to do this
--- cmmLoopifyForC p@(CmmProc Nothing _ _) = p  -- only if there's an info table, ignore case alts
-cmmLoopifyForC dflags (CmmProc infos entry_lbl live
-                 (ListGraph blocks@(BasicBlock top_id _ : _))) =
---  pprTrace "jump_lbl" (ppr jump_lbl <+> ppr entry_lbl) $
-  CmmProc infos entry_lbl live (ListGraph blocks')
-  where blocks' = [ BasicBlock id (map do_stmt stmts)
-                  | BasicBlock id stmts <- blocks ]
-
-        do_stmt (CmmJump (CmmLit (CmmLabel lbl)) _) | lbl == jump_lbl
-                = CmmBranch top_id
-        do_stmt stmt = stmt
-
-        jump_lbl | tablesNextToCode dflags = toInfoLbl entry_lbl
-                 | otherwise               = entry_lbl
-
-cmmLoopifyForC _ top = top
--}
-
 -- -----------------------------------------------------------------------------
 -- Utils
 



More information about the ghc-commits mailing list