Desugar applications of 'seq' specially; fix Trac #1031
Desugar applications of 'seq' specially; fix Trac #1031

Merge to 6.6 branch.  Test case is dsrun014.

Note [Desugaring seq]  cf Trac #1031
~~~~~~~~~~~~~~~~~~~~~
   f x y = x `seq` (y `seq` (# x,y #))

The [CoreSyn let/app invariant] means that, other things being equal, because 
the argument to the outer 'seq' has an unlifted type, we'll use call-by-value thus:

   f x y = case (y `seq` (# x,y #)) of v -> x `seq` v

But that is bad for two reasons: 
  (a) we now evaluate y before x, and 
  (b) we can't bind v to an unboxed pair

Seq is very, very special!  So we recognise it right here, and desugar to
	case x of _ -> case y of _ -> (# x,y #)

The special case would be valid for all calls to 'seq', but it's only *necessary*
for ones whose second argument has an unlifted type. So we only catch the latter
case here, to avoid unnecessary tests.


lukexi/ghc-7.8-arm64,nushio3/ghc,mettekou/ghc,ilyasergey/GHC-XAppFix,anton-dessiatov/ghc,mettekou/ghc,shlevy/ghc,AlexanderPankiv/ghc,sgillespie/ghc,mcschroeder/ghc,vTurbine/ghc,spacekitteh/smcghc,GaloisInc/halvm-ghc,snoyberg/ghc,TomMD/ghc,fmthoma/ghc,lukexi/ghc-7.8-arm64,nathyong/microghc-ghc,nushio3/ghc,gcampax/ghc,sdiehl/ghc,mettekou/ghc,elieux/ghc,anton-dessiatov/ghc,GaloisInc/halvm-ghc,hferreiro/replay,vTurbine/ghc,oldmanmike/ghc,mfine/ghc,nkaretnikov/ghc,vikraman/ghc,da-x/ghc,ryantm/ghc,gridaphobe/ghc,gridaphobe/ghc,da-x/ghc,fmthoma/ghc,mcschroeder/ghc,snoyberg/ghc,ml9951/ghc,TomMD/ghc,oldmanmike/ghc,wxwxwwxxx/ghc,mfine/ghc,elieux/ghc,anton-dessiatov/ghc,olsner/ghc,vTurbine/ghc,ezyang/ghc,urbanslug/ghc,gcampax/ghc,gridaphobe/ghc,bitemyapp/ghc,tjakway/ghcjvm,da-x/ghc,acowley/ghc,tjakway/ghcjvm,gcampax/ghc,tjakway/ghcjvm,gridaphobe/ghc,frantisekfarka/ghc-dsi,nushio3/ghc,elieux/ghc,ryantm/ghc,mfine/ghc,acowley/ghc,holzensp/ghc,jstolarek/ghc,vTurbine/ghc,ekmett/ghc,bitemyapp/ghc,ml9951/ghc,vikraman/ghc,mettekou/ghc,ekmett/ghc,mfine/ghc,forked-upstream-packages-for-ghcjs/ghc,frantisekfarka/ghc-dsi,da-x/ghc,acowley/ghc,forked-upstream-packages-for-ghcjs/ghc,lukexi/ghc,lukexi/ghc,lukexi/ghc,fmthoma/ghc,elieux/ghc,TomMD/ghc,ghc-android/ghc,holzensp/ghc,wxwxwwxxx/ghc,elieux/ghc,ezyang/ghc,ekmett/ghc,spacekitteh/smcghc,shlevy/ghc,green-haskell/ghc,GaloisInc/halvm-ghc,hferreiro/replay,olsner/ghc,christiaanb/ghc,christiaanb/ghc,green-haskell/ghc,siddhanathan/ghc,oldmanmike/ghc,acowley/ghc,vTurbine/ghc,jstolarek/ghc,ekmett/ghc,nkaretnikov/ghc,nushio3/ghc,AlexanderPankiv/ghc,tjakway/ghcjvm,ezyang/ghc,nushio3/ghc,ezyang/ghc,ml9951/ghc,wxwxwwxxx/ghc,nushio3/ghc,siddhanathan/ghc,mfine/ghc,TomMD/ghc,fmthoma/ghc,oldmanmike/ghc,sdiehl/ghc,snoyberg/ghc,shlevy/ghc,mcmaniac/ghc,tjakway/ghcjvm,siddhanathan/ghc,nomeata/ghc,urbanslug/ghc,anton-dessiatov/ghc,holzensp/ghc,acowley/ghc,ml9951/ghc,vTurbine/ghc,vikraman/ghc,holzensp/ghc,oldmanmike/ghc,mcmaniac/ghc,bitemyapp/ghc,sgillespie/ghc,TomMD/ghc,nomeata/ghc,AlexanderPankiv/ghc,elieux/ghc,mcmaniac/ghc,snoyberg/ghc,siddhanathan/ghc,oldmanmike/ghc,da-x/ghc,mcschroeder/ghc,nathyong/microghc-ghc,snoyberg/ghc,nomeata/ghc,da-x/ghc,ghc-android/ghc,snoyberg/ghc,tibbe/ghc,hferreiro/replay,ghc-android/ghc,jstolarek/ghc,mettekou/ghc,vikraman/ghc,spacekitteh/smcghc,ryantm/ghc,sgillespie/ghc,GaloisInc/halvm-ghc,wxwxwwxxx/ghc,nathyong/microghc-ghc,christiaanb/ghc,ghc-android/ghc,anton-dessiatov/ghc,frantisekfarka/ghc-dsi,acowley/ghc,wxwxwwxxx/ghc,christiaanb/ghc,nkaretnikov/ghc,siddhanathan/ghc,vTurbine/ghc,nomeata/ghc,ezyang/ghc,AlexanderPankiv/ghc,lukexi/ghc-7.8-arm64,nathyong/microghc-ghc,frantisekfarka/ghc-dsi,mettekou/ghc,nomeata/ghc,siddhanathan/ghc,ml9951/ghc,jstolarek/ghc,tibbe/ghc,lukexi/ghc-7.8-arm64,olsner/ghc,forked-upstream-packages-for-ghcjs/ghc,gcampax/ghc,green-haskell/ghc,gridaphobe/ghc,mcmaniac/ghc,urbanslug/ghc,jstolarek/ghc,nkaretnikov/ghc,AlexanderPankiv/ghc,urbanslug/ghc,anton-dessiatov/ghc,hferreiro/replay,fmthoma/ghc,wxwxwwxxx/ghc,ghc-android/ghc,hferreiro/replay,mcmaniac/ghc,gcampax/ghc,spacekitteh/smcghc,sdiehl/ghc,nathyong/microghc-ghc,forked-upstream-packages-for-ghcjs/ghc,nathyong/microghc-ghc,mettekou/ghc,ryantm/ghc,siddhanathan/ghc,ilyasergey/GHC-XAppFix,fmthoma/ghc,oldmanmike/ghc,lukexi/ghc,sgillespie/ghc,GaloisInc/halvm-ghc,christiaanb/ghc,ilyasergey/GHC-XAppFix,ml9951/ghc,hferreiro/replay,forked-upstream-packages-for-ghcjs/ghc,urbanslug/ghc,mcschroeder/ghc,AlexanderPankiv/ghc,ml9951/ghc,gridaphobe/ghc,wxwxwwxxx/ghc,GaloisInc/halvm-ghc,tibbe/ghc,vikraman/ghc,shlevy/ghc,TomMD/ghc,green-haskell/ghc,urbanslug/ghc,ryantm/ghc,TomMD/ghc,lukexi/ghc-7.8-arm64,ilyasergey/GHC-XAppFix,nkaretnikov/ghc,ezyang/ghc,ekmett/ghc,fmthoma/ghc,anton-dessiatov/ghc,shlevy/ghc,sdiehl/ghc,lukexi/ghc,mcschroeder/ghc,sgillespie/ghc,tibbe/ghc,shlevy/ghc,olsner/ghc,sdiehl/ghc,vikraman/ghc,acowley/ghc,da-x/ghc,olsner/ghc,spacekitteh/smcghc,tjakway/ghcjvm,ghc-android/ghc,mfine/ghc,gridaphobe/ghc,nkaretnikov/ghc,mfine/ghc,nathyong/microghc-ghc,forked-upstream-packages-for-ghcjs/ghc,shlevy/ghc,tjakway/ghcjvm,hferreiro/replay,holzensp/ghc,tibbe/ghc,vikraman/ghc,forked-upstream-packages-for-ghcjs/ghc,urbanslug/ghc,green-haskell/ghc,bitemyapp/ghc,sdiehl/ghc,frantisekfarka/ghc-dsi,olsner/ghc,nkaretnikov/ghc,christiaanb/ghc,snoyberg/ghc,gcampax/ghc,christiaanb/ghc,ghc-android/ghc,elieux/ghc,olsner/ghc,ezyang/ghc,GaloisInc/halvm-ghc,mcschroeder/ghc,sgillespie/ghc,gcampax/ghc,ml9951/ghc,sdiehl/ghc,sgillespie/ghc,nushio3/ghc,mcschroeder/ghc,bitemyapp/ghc,AlexanderPankiv/ghc