- | id' == fid, False ->
- tail id (ft fid : ppr (CmmCondBranch expr tid) : prev') t bs
- | id' == tid, Just e' <- maybeInvertCmmExpr expr, False ->
- tail id (ft tid : ppr (CmmCondBranch e' fid) : prev') t bs
- _ -> endblock (ppr l)
- l@(G.LastJump {}) -> endblock $ ppr l
- l@(G.LastReturn {}) -> endblock $ ppr l
- l@(G.LastSwitch {}) -> endblock $ ppr l
- l@(G.LastCall _ _ Nothing) -> endblock $ ppr l
- l@(G.LastCall tgt args (Just k))
- | Z.Block id' (Z.ZTail (G.CopyIn _ ress srt) t) : bs <- n,
- id' == k ->
- let call = CmmCall tgt ress args (CmmSafe srt) CmmMayReturn
- ppcall = ppr call <+> parens (text "ret to" <+> ppr k)
- in if unique_pred k then
- tail id (ppcall : prev') t bs
- else
- endblock (ppcall)
- | Z.Block id' t : bs <- n, id' == k, unique_pred k,
- Just (ress, srt) <- findCopyIn t ->
- let call = CmmCall tgt ress args (CmmSafe srt) CmmMayReturn
- delayed =
- ptext SLIT("// delayed CopyIn follows previous call")
- in tail id (delayed : ppr call : prev') t bs
- | otherwise -> endblock $ ppr l
- findCopyIn (Z.ZTail (G.CopyIn _ ress srt) _) = Just (ress, srt)
- findCopyIn (Z.ZTail _ t) = findCopyIn t
- findCopyIn (Z.ZLast _) = Nothing
+ | id' == fid, isNothing out ->
+ tail id (ft fid : ppr (CmmCondBranch expr tid) : prev') Nothing t bs
+ | id' == tid, Just e' <- maybeInvertCmmExpr expr, isNothing out->
+ tail id (ft tid : ppr (CmmCondBranch e' fid) : prev') Nothing t bs
+ _ -> endblock $ with_out out l
+ l@(G.LastSwitch {}) -> endblock $ with_out out l
+ l@(G.LastCall _ _ _ _ _) -> endblock $ with_out out l