[commit: ghc] wip/T14373: join *after* the second switch (ba28c54)

git at git.haskell.org git at git.haskell.org
Wed Dec 13 21:32:17 UTC 2017


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

On branch  : wip/T14373
Link       : http://ghc.haskell.org/trac/ghc/changeset/ba28c54db4890ce44c37ee327eedcc827501efbc/ghc

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

commit ba28c54db4890ce44c37ee327eedcc827501efbc
Author: Gabor Greif <ggreif at gmail.com>
Date:   Wed Dec 13 15:50:17 2017 +0100

    join *after* the second switch


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

ba28c54db4890ce44c37ee327eedcc827501efbc
 compiler/codeGen/StgCmmExpr.hs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/codeGen/StgCmmExpr.hs b/compiler/codeGen/StgCmmExpr.hs
index 6c00cef..21b8045 100644
--- a/compiler/codeGen/StgCmmExpr.hs
+++ b/compiler/codeGen/StgCmmExpr.hs
@@ -634,11 +634,14 @@ cgAlts gc_plan bndr (AlgAlt tycon) alts
 
                 (mb_deflt, mb_branch) <- prelabel mb_deflt
                 emitSwitch tag_expr (catchall : ptr) mb_deflt 1 maxpt
+                join_lbl <- newBlockId
+                emit (mkBranch join_lbl)
                 emitLabel infos_lbl
                 let untagged_ptr = cmmUntag dflags (CmmReg bndr_reg)
                     tag_expr = getConstrTag dflags untagged_ptr
                     info0 = (\(tag,branch)->(tag-1,branch)) <$> info
                 emitSwitch tag_expr info0 mb_branch (maxpt - 1) (fam_sz - 1)
+                emitLabel join_lbl
 
         ; return AssignedDirectly }
 



More information about the ghc-commits mailing list