Fix three problems with occurrence analysis on case alternatives.
Fix three problems with occurrence analysis on case alternatives.

Summary:
  1. Respect condition (a) in Note [Binder swap]
  2. Respect condition (b) in Note [Binder swap]
  3. Return usage of any coercion variables in binder swap

Fixes T9440

Test Plan: See #9440

Reviewers: simonpj, austin

Reviewed By: simonpj, austin

Subscribers: simonpj, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D156

GHC Trac Issues: #9440

ghc-android/ghc,GaloisInc/halvm-ghc,vTurbine/ghc,olsner/ghc,vTurbine/ghc,nathyong/microghc-ghc,green-haskell/ghc,nathyong/microghc-ghc,vikraman/ghc,ezyang/ghc,olsner/ghc,elieux/ghc,oldmanmike/ghc,vTurbine/ghc,fmthoma/ghc,vikraman/ghc,christiaanb/ghc,gridaphobe/ghc,vikraman/ghc,acowley/ghc,anton-dessiatov/ghc,urbanslug/ghc,green-haskell/ghc,da-x/ghc,tjakway/ghcjvm,sgillespie/ghc,sgillespie/ghc,mfine/ghc,da-x/ghc,oldmanmike/ghc,olsner/ghc,elieux/ghc,urbanslug/ghc,ghc-android/ghc,TomMD/ghc,forked-upstream-packages-for-ghcjs/ghc,gridaphobe/ghc,acowley/ghc,AlexanderPankiv/ghc,nushio3/ghc,AlexanderPankiv/ghc,green-haskell/ghc,mettekou/ghc,gcampax/ghc,fmthoma/ghc,siddhanathan/ghc,wxwxwwxxx/ghc,fmthoma/ghc,sdiehl/ghc,da-x/ghc,fmthoma/ghc,mfine/ghc,spacekitteh/smcghc,bitemyapp/ghc,mfine/ghc,AlexanderPankiv/ghc,mcschroeder/ghc,elieux/ghc,christiaanb/ghc,shlevy/ghc,sgillespie/ghc,siddhanathan/ghc,wxwxwwxxx/ghc,nushio3/ghc,ml9951/ghc,ml9951/ghc,da-x/ghc,vTurbine/ghc,urbanslug/ghc,oldmanmike/ghc,shlevy/ghc,tjakway/ghcjvm,nathyong/microghc-ghc,forked-upstream-packages-for-ghcjs/ghc,nushio3/ghc,oldmanmike/ghc,shlevy/ghc,TomMD/ghc,nushio3/ghc,tjakway/ghcjvm,gcampax/ghc,siddhanathan/ghc,gridaphobe/ghc,mettekou/ghc,urbanslug/ghc,oldmanmike/ghc,sdiehl/ghc,ghc-android/ghc,christiaanb/ghc,wxwxwwxxx/ghc,forked-upstream-packages-for-ghcjs/ghc,shlevy/ghc,nkaretnikov/ghc,nushio3/ghc,gcampax/ghc,nkaretnikov/ghc,bitemyapp/ghc,sgillespie/ghc,snoyberg/ghc,wxwxwwxxx/ghc,snoyberg/ghc,da-x/ghc,nathyong/microghc-ghc,anton-dessiatov/ghc,forked-upstream-packages-for-ghcjs/ghc,ml9951/ghc,sdiehl/ghc,tjakway/ghcjvm,green-haskell/ghc,gridaphobe/ghc,spacekitteh/smcghc,tjakway/ghcjvm,vTurbine/ghc,acowley/ghc,anton-dessiatov/ghc,forked-upstream-packages-for-ghcjs/ghc,christiaanb/ghc,jstolarek/ghc,sdiehl/ghc,siddhanathan/ghc,mettekou/ghc,snoyberg/ghc,sgillespie/ghc,mcschroeder/ghc,mfine/ghc,ezyang/ghc,GaloisInc/halvm-ghc,TomMD/ghc,TomMD/ghc,jstolarek/ghc,mcschroeder/ghc,urbanslug/ghc,ghc-android/ghc,snoyberg/ghc,vTurbine/ghc,urbanslug/ghc,forked-upstream-packages-for-ghcjs/ghc,anton-dessiatov/ghc,bitemyapp/ghc,green-haskell/ghc,gridaphobe/ghc,vikraman/ghc,GaloisInc/halvm-ghc,shlevy/ghc,nkaretnikov/ghc,anton-dessiatov/ghc,oldmanmike/ghc,ml9951/ghc,siddhanathan/ghc,AlexanderPankiv/ghc,mcschroeder/ghc,elieux/ghc,GaloisInc/halvm-ghc,TomMD/ghc,da-x/ghc,acowley/ghc,acowley/ghc,jstolarek/ghc,gridaphobe/ghc,TomMD/ghc,oldmanmike/ghc,mcschroeder/ghc,mfine/ghc,TomMD/ghc,tjakway/ghcjvm,jstolarek/ghc,wxwxwwxxx/ghc,siddhanathan/ghc,olsner/ghc,nathyong/microghc-ghc,christiaanb/ghc,ghc-android/ghc,elieux/ghc,nathyong/microghc-ghc,ezyang/ghc,ghc-android/ghc,christiaanb/ghc,jstolarek/ghc,mfine/ghc,da-x/ghc,olsner/ghc,forked-upstream-packages-for-ghcjs/ghc,bitemyapp/ghc,gcampax/ghc,sgillespie/ghc,ezyang/ghc,elieux/ghc,vikraman/ghc,sdiehl/ghc,tjakway/ghcjvm,ezyang/ghc,shlevy/ghc,mettekou/ghc,shlevy/ghc,mcschroeder/ghc,snoyberg/ghc,GaloisInc/halvm-ghc,nushio3/ghc,vTurbine/ghc,nkaretnikov/ghc,ezyang/ghc,mettekou/ghc,ml9951/ghc,gcampax/ghc,elieux/ghc,ml9951/ghc,nushio3/ghc,snoyberg/ghc,bitemyapp/ghc,sdiehl/ghc,sgillespie/ghc,gridaphobe/ghc,nathyong/microghc-ghc,anton-dessiatov/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,fmthoma/ghc,vikraman/ghc,spacekitteh/smcghc,snoyberg/ghc,wxwxwwxxx/ghc,spacekitteh/smcghc,anton-dessiatov/ghc,gcampax/ghc,acowley/ghc,ezyang/ghc,mcschroeder/ghc,acowley/ghc,ghc-android/ghc,AlexanderPankiv/ghc,mfine/ghc,nkaretnikov/ghc,AlexanderPankiv/ghc,AlexanderPankiv/ghc,GaloisInc/halvm-ghc,wxwxwwxxx/ghc,urbanslug/ghc,ml9951/ghc,olsner/ghc,spacekitteh/smcghc,mettekou/ghc,nkaretnikov/ghc,fmthoma/ghc,gcampax/ghc,fmthoma/ghc,vikraman/ghc,christiaanb/ghc,ml9951/ghc,sdiehl/ghc,mettekou/ghc,nkaretnikov/ghc,olsner/ghc