+ -- if we can knock off a bunch of default cases with one if, then do so
+ | Just deflt <- mb_deflt, (lowest_branch - lo_tag) >= n_branches
+ = do { (assign_tag, tag_expr') <- assignTemp' tag_expr
+ ; let cond = cmmULtWord tag_expr' (CmmLit (mkIntCLit lowest_branch))
+ ; stmtC (CmmCondBranch cond deflt)
+ ; mk_switch tag_expr' branches mb_deflt lowest_branch hi_tag
+ }
+
+ | Just deflt <- mb_deflt, (hi_tag - highest_branch) >= n_branches
+ = do { (assign_tag, tag_expr') <- assignTemp' tag_expr
+ ; let cond = cmmUGtWord tag_expr' (CmmLit (mkIntCLit highest_branch))
+ ; stmtC (CmmCondBranch cond deflt)
+ ; mk_switch tag_expr' branches mb_deflt lo_tag highest_branch
+ }
+