- = case (min (getBinderInfoArity info1) (getBinderInfoArity info2)) of
- (I# i#) -> ManyOcc (I# i#)
-
--- (andBinderInfo orig new) is used in two situations:
--- First, when a variable whose occurrence info
--- is currently "orig" is bound to a variable whose occurrence info is "new"
--- eg (\new -> e) orig
--- What we want to do is to *worsen* orig's info to take account of new's
---
--- second, when completing a let-binding
--- let new = ...orig...
--- we compute the way orig occurs in (...orig...), and then use orBinderInfo
--- to worsen this info by the way new occurs in the let body; then we use
--- that to worsen orig's currently recorded occurrence info.
-
-andBinderInfo DeadCode info2 = DeadCode
-andBinderInfo info1 DeadCode = DeadCode
-andBinderInfo (OneOcc posn1 dup1 scc1 (I# n_alts1#) (I# ar_1#))
- (OneOcc posn2 dup2 scc2 (I# n_alts2#) ar_2)
- = let
- -- Perversly maligned in order to make it stricter.
- posn = combine_posns posn1 posn2
- scc = combine_sccs scc1 scc2
- dup = combine_dups dup1 dup2
- alts = I# (n_alts1# +# n_alts2#)
-
- -- No CSE, please!
- cont1 = case scc of { InsideSCC -> cont2; _ -> cont2 }
- cont2 = case dup of { DupDanger -> cont3; _ -> cont3 }
- cont3 = case alts of { (I# 0#) -> cont4; _ -> cont4 }
- cont4 = OneOcc posn dup scc alts (I# ar_1#)
- in
- case posn of {FunOcc -> cont1; _ -> cont1}