Commit 0dd61fe7 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

Kill redundant patterns

George's new exhaustiveness checker now realizes these are impossible.
Yay!
parent 7b29b0b1
...@@ -163,7 +163,6 @@ arfGraph pass@FwdPass { fp_lattice = lattice, ...@@ -163,7 +163,6 @@ arfGraph pass@FwdPass { fp_lattice = lattice,
-> Fact e f -> UniqSM (DG f n e C, Fact C f) -> 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 NothingC (JustO entry) f = (block entry `cat` body (successors entry) bdy) f
c (JustC entries) NothingO f = body entries bdy f c (JustC entries) NothingO f = body entries bdy f
c _ _ _ = error "bogus GADT pattern match failure"
-- Lift from nodes to blocks -- Lift from nodes to blocks
block BNil f = return (dgnil, f) block BNil f = return (dgnil, f)
...@@ -253,7 +252,6 @@ analyzeFwd FwdPass { fp_lattice = lattice, ...@@ -253,7 +252,6 @@ analyzeFwd FwdPass { fp_lattice = lattice,
= case (entries, entry) of = case (entries, entry) of
(NothingC, JustO entry) -> block entry `cat` body (successors entry) (NothingC, JustO entry) -> block entry `cat` body (successors entry)
(JustC entries, NothingO) -> body entries (JustC entries, NothingO) -> body entries
_ -> error "bogus GADT pattern match failure"
where where
body :: [Label] -> Fact C f -> Fact C f body :: [Label] -> Fact C f -> Fact C f
body entries f body entries f
...@@ -296,7 +294,6 @@ analyzeFwdBlocks FwdPass { fp_lattice = lattice, ...@@ -296,7 +294,6 @@ analyzeFwdBlocks FwdPass { fp_lattice = lattice,
= case (entries, entry) of = case (entries, entry) of
(NothingC, JustO entry) -> block entry `cat` body (successors entry) (NothingC, JustO entry) -> block entry `cat` body (successors entry)
(JustC entries, NothingO) -> body entries (JustC entries, NothingO) -> body entries
_ -> error "bogus GADT pattern match failure"
where where
body :: [Label] -> Fact C f -> Fact C f body :: [Label] -> Fact C f -> Fact C f
body entries f body entries f
...@@ -339,7 +336,6 @@ analyzeBwd BwdPass { bp_lattice = lattice, ...@@ -339,7 +336,6 @@ analyzeBwd BwdPass { bp_lattice = lattice,
= case (entries, entry) of = case (entries, entry) of
(NothingC, JustO entry) -> body (successors entry) (NothingC, JustO entry) -> body (successors entry)
(JustC entries, NothingO) -> body entries (JustC entries, NothingO) -> body entries
_ -> error "bogus GADT pattern match failure"
where where
body :: [Label] -> Fact C f -> Fact C f body :: [Label] -> Fact C f -> Fact C f
body entries f body entries f
...@@ -429,7 +425,6 @@ arbGraph pass@BwdPass { bp_lattice = lattice, ...@@ -429,7 +425,6 @@ arbGraph pass@BwdPass { bp_lattice = lattice,
-> Fact C f -> UniqSM (DG f n e C, Fact e f) -> 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 NothingC (JustO entry) f = (block entry `cat` body (successors entry) bdy) f
c (JustC entries) NothingO f = body entries bdy f c (JustC entries) NothingO f = body entries bdy f
c _ _ _ = error "bogus GADT pattern match failure"
-- Lift from nodes to blocks -- Lift from nodes to blocks
block BNil f = return (dgnil, f) block BNil f = return (dgnil, f)
......
...@@ -355,9 +355,6 @@ graphAddCoalesce (r1, r2) graph ...@@ -355,9 +355,6 @@ graphAddCoalesce (r1, r2) graph
, RegReal _ <- r2 , RegReal _ <- r2
= graph = graph
graphAddCoalesce _ _
= panic "graphAddCoalesce: bogus"
-- | Patch registers in code using the reg -> reg mapping in this graph. -- | Patch registers in code using the reg -> reg mapping in this graph.
patchRegsFromGraph patchRegsFromGraph
......
...@@ -909,8 +909,6 @@ livenessForward platform rsLiveEntry (li@(LiveInstr instr mLive) : lis) ...@@ -909,8 +909,6 @@ livenessForward platform rsLiveEntry (li@(LiveInstr instr mLive) : lis)
in LiveInstr instr (Just live { liveBorn = rsBorn }) in LiveInstr instr (Just live { liveBorn = rsBorn })
: livenessForward platform rsLiveNext lis : livenessForward platform rsLiveNext lis
livenessForward _ _ _ = panic "RegLiveness.livenessForward: no match"
-- | Calculate liveness going backwards, -- | Calculate liveness going backwards,
-- filling in when regs die, and what regs are live across each instruction -- filling in when regs die, and what regs are live across each instruction
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment