[commit: ghc] wip/T12618: Handle ConApp in "Eliminate Identity Case" (d192218)

git at git.haskell.org git at git.haskell.org
Thu Oct 6 23:20:37 UTC 2016


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

On branch  : wip/T12618
Link       : http://ghc.haskell.org/trac/ghc/changeset/d1922185829f5ee2eac8c9797d732aa653b0408d/ghc

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

commit d1922185829f5ee2eac8c9797d732aa653b0408d
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Oct 5 17:43:05 2016 -0400

    Handle ConApp in "Eliminate Identity Case"


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

d1922185829f5ee2eac8c9797d732aa653b0408d
 compiler/simplCore/SimplUtils.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs
index 1f27395..5984006 100644
--- a/compiler/simplCore/SimplUtils.hs
+++ b/compiler/simplCore/SimplUtils.hs
@@ -1820,6 +1820,8 @@ mkCase1 _dflags scrut case_bndr _ alts@((_,_,rhs1) : _)      -- Identity case
         -- See Note [RHS casts]
     check_eq (Lit lit)  (LitAlt lit') _    = lit == lit'
     check_eq (Var v) _ _  | v == case_bndr = True
+    check_eq (ConApp con [])  (DataAlt con') [] = con == con'
+                                             -- Optimisation only
     check_eq (Var v)    (DataAlt con) []   = v == dataConWorkId con
                                              -- Optimisation only
     check_eq (Tick t e) alt           args = tickishFloatable t &&



More information about the ghc-commits mailing list