diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-07-03 15:19:15 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-07-03 15:19:15 +0100 |
commit | 2491856e735c654f7d3a83b516d92ef115287853 (patch) | |
tree | 3b90160b668fc16b49da5689f3d03a657c498d56 | |
parent | 85fed344855acfcee01aaae419b6a86af6c7952d (diff) | |
download | haskell-2491856e735c654f7d3a83b516d92ef115287853.tar.gz |
no need to check for unreachable blocks with -fnew-codegen
we've already done it
-rw-r--r-- | compiler/nativeGen/AsmCodeGen.lhs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs index a8fd604cc1..454dd86eaf 100644 --- a/compiler/nativeGen/AsmCodeGen.lhs +++ b/compiler/nativeGen/AsmCodeGen.lhs @@ -857,7 +857,12 @@ cmmToCmm :: DynFlags -> RawCmmDecl -> (RawCmmDecl, [CLabel]) cmmToCmm _ top@(CmmData _ _) = (top, []) cmmToCmm dflags (CmmProc info lbl (ListGraph blocks)) = runCmmOpt dflags $ do let platform = targetPlatform dflags - blocks' <- mapM cmmBlockConFold (cmmMiniInline platform (cmmEliminateDeadBlocks blocks)) + + let reachable_blocks | dopt Opt_TryNewCodeGen dflags = blocks + | otherwise = cmmEliminateDeadBlocks blocks + -- The new codegen path has already eliminated unreachable blocks by now + + blocks' <- mapM cmmBlockConFold (cmmMiniInline platform reachable_blocks) return $ CmmProc info lbl (ListGraph blocks') newtype CmmOptM a = CmmOptM (([CLabel], DynFlags) -> (# a, [CLabel] #)) |