[commit: ghc] master: Kill redundant patterns (0dd61fe)
git at git.haskell.org
git at git.haskell.org
Thu Dec 3 22:00:45 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0dd61fe72144a829a9e5bb87a1094244e53cdebb/ghc
>---------------------------------------------------------------
commit 0dd61fe72144a829a9e5bb87a1094244e53cdebb
Author: Ben Gamari <ben at smart-cactus.org>
Date: Thu Dec 3 13:43:39 2015 -0500
Kill redundant patterns
George's new exhaustiveness checker now realizes these are impossible.
Yay!
>---------------------------------------------------------------
0dd61fe72144a829a9e5bb87a1094244e53cdebb
compiler/cmm/Hoopl/Dataflow.hs | 5 -----
compiler/nativeGen/RegAlloc/Graph/Main.hs | 3 ---
compiler/nativeGen/RegAlloc/Liveness.hs | 2 --
3 files changed, 10 deletions(-)
diff --git a/compiler/cmm/Hoopl/Dataflow.hs b/compiler/cmm/Hoopl/Dataflow.hs
index 29c7afe..beaf6bc 100644
--- a/compiler/cmm/Hoopl/Dataflow.hs
+++ b/compiler/cmm/Hoopl/Dataflow.hs
@@ -163,7 +163,6 @@ arfGraph pass at FwdPass { fp_lattice = lattice,
-> Fact e f -> UniqSM (DG f n e C, Fact C f)
c NothingC (JustO entry) f = (block entry `cat` body (successors entry) bdy) f
c (JustC entries) NothingO f = body entries bdy f
- c _ _ _ = error "bogus GADT pattern match failure"
-- Lift from nodes to blocks
block BNil f = return (dgnil, f)
@@ -253,7 +252,6 @@ analyzeFwd FwdPass { fp_lattice = lattice,
= case (entries, entry) of
(NothingC, JustO entry) -> block entry `cat` body (successors entry)
(JustC entries, NothingO) -> body entries
- _ -> error "bogus GADT pattern match failure"
where
body :: [Label] -> Fact C f -> Fact C f
body entries f
@@ -296,7 +294,6 @@ analyzeFwdBlocks FwdPass { fp_lattice = lattice,
= case (entries, entry) of
(NothingC, JustO entry) -> block entry `cat` body (successors entry)
(JustC entries, NothingO) -> body entries
- _ -> error "bogus GADT pattern match failure"
where
body :: [Label] -> Fact C f -> Fact C f
body entries f
@@ -339,7 +336,6 @@ analyzeBwd BwdPass { bp_lattice = lattice,
= case (entries, entry) of
(NothingC, JustO entry) -> body (successors entry)
(JustC entries, NothingO) -> body entries
- _ -> error "bogus GADT pattern match failure"
where
body :: [Label] -> Fact C f -> Fact C f
body entries f
@@ -429,7 +425,6 @@ arbGraph pass at BwdPass { bp_lattice = lattice,
-> Fact C f -> UniqSM (DG f n e C, Fact e f)
c NothingC (JustO entry) f = (block entry `cat` body (successors entry) bdy) f
c (JustC entries) NothingO f = body entries bdy f
- c _ _ _ = error "bogus GADT pattern match failure"
-- Lift from nodes to blocks
block BNil f = return (dgnil, f)
diff --git a/compiler/nativeGen/RegAlloc/Graph/Main.hs b/compiler/nativeGen/RegAlloc/Graph/Main.hs
index 05db68d..8d5a4db 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Main.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Main.hs
@@ -355,9 +355,6 @@ graphAddCoalesce (r1, r2) graph
, RegReal _ <- r2
= graph
-graphAddCoalesce _ _
- = panic "graphAddCoalesce: bogus"
-
-- | Patch registers in code using the reg -> reg mapping in this graph.
patchRegsFromGraph
diff --git a/compiler/nativeGen/RegAlloc/Liveness.hs b/compiler/nativeGen/RegAlloc/Liveness.hs
index 167197d..c1c2e3c 100644
--- a/compiler/nativeGen/RegAlloc/Liveness.hs
+++ b/compiler/nativeGen/RegAlloc/Liveness.hs
@@ -909,8 +909,6 @@ livenessForward platform rsLiveEntry (li@(LiveInstr instr mLive) : lis)
in LiveInstr instr (Just live { liveBorn = rsBorn })
: livenessForward platform rsLiveNext lis
-livenessForward _ _ _ = panic "RegLiveness.livenessForward: no match"
-
-- | Calculate liveness going backwards,
-- filling in when regs die, and what regs are live across each instruction
More information about the ghc-commits
mailing list