summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmOpt.hs
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2013-10-16 13:12:12 +0200
committerJan Stolarek <jan.stolarek@p.lodz.pl>2013-10-16 13:12:12 +0200
commita05ffbd9ae09a22e6ab08b14a111988cf6846590 (patch)
treed48bca34e424c1ab7ea8f746f87528ed9da68800 /compiler/cmm/CmmOpt.hs
parent738e2f122f427d8ea05a509793952b4216ed8212 (diff)
downloadhaskell-a05ffbd9ae09a22e6ab08b14a111988cf6846590.tar.gz
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.
Diffstat (limited to 'compiler/cmm/CmmOpt.hs')
-rw-r--r--compiler/cmm/CmmOpt.hs48
1 files changed, 0 insertions, 48 deletions
diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs
index 359d44b752..acaed28acf 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