[commit: ghc] master: Remove redundant check in cgCase (d13b7d6)

git at git.haskell.org git at git.haskell.org
Tue Nov 20 13:32:58 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d13b7d60650cb84af11ee15b3f51c3511548cfdb/ghc

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

commit d13b7d60650cb84af11ee15b3f51c3511548cfdb
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Tue Nov 20 16:30:15 2018 +0300

    Remove redundant check in cgCase
    
    D5339 (part of D5324) removed the dead case binder analysis done during
    CoreToStg so this condition always holds now.
    
    Test Plan: Validated locally.
    
    Reviewers: sgraf, bgamari, simonmar
    
    Subscribers: rwbarton, carter
    
    Differential Revision: https://phabricator.haskell.org/D5358


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

d13b7d60650cb84af11ee15b3f51c3511548cfdb
 compiler/codeGen/StgCmmExpr.hs | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/compiler/codeGen/StgCmmExpr.hs b/compiler/codeGen/StgCmmExpr.hs
index e8d111f..2430a0d 100644
--- a/compiler/codeGen/StgCmmExpr.hs
+++ b/compiler/codeGen/StgCmmExpr.hs
@@ -304,13 +304,10 @@ cgCase (StgOpApp (StgPrimOp op) args _) bndr (AlgAlt tycon) alts
   | isEnumerationTyCon tycon -- Note [case on bool]
   = do { tag_expr <- do_enum_primop op args
 
-       -- If the binder is not dead, convert the tag to a constructor
-       -- and assign it.
-       ; unless (isDeadBinder bndr) $ do
-            { dflags <- getDynFlags
-            ; tmp_reg <- bindArgToReg (NonVoid bndr)
-            ; emitAssign (CmmLocal tmp_reg)
-                         (tagToClosure dflags tycon tag_expr) }
+       ; dflags <- getDynFlags
+       ; tmp_reg <- bindArgToReg (NonVoid bndr)
+       ; emitAssign (CmmLocal tmp_reg)
+                    (tagToClosure dflags tycon tag_expr)
 
        ; (mb_deflt, branches) <- cgAlgAltRhss (NoGcInAlts,AssignedDirectly)
                                               (NonVoid bndr) alts



More information about the ghc-commits mailing list