[CCP] Rework CCP to use an inverted algorithm.
[CCP] Rework CCP to use an inverted algorithm.

Instead of adding all the instructions into the WorkList to begin with,
add only the constants and try to fold their users. Each time a user can
be folded, add it to the WorkList. This keeps the WorkList smaller.

The inverted algorithm also allows to simplify the handling of struct_extract
and tuple_extract.

(as suggested by Chris in comments on r9545)

Swift SVN r9598

jopamer/swift,tkremenek/swift,therealbnut/swift,cbrentharris/swift,ken0nek/swift,SwiftAndroid/swift,danielmartin/swift,russbishop/swift,CodaFi/swift,codestergit/swift,Jnosh/swift,tkremenek/swift,emilstahl/swift,swiftix/swift,calebd/swift,gottesmm/swift,return/swift,shahmishal/swift,dduan/swift,parkera/swift,OscarSwanros/swift,johnno1962d/swift,Jnosh/swift,tkremenek/swift,harlanhaskins/swift,JaSpa/swift,SwiftAndroid/swift,ahoppen/swift,hooman/swift,gregomni/swift,kusl/swift,zisko/swift,sschiau/swift,return/swift,jtbandes/swift,gribozavr/swift,LeoShimonaka/swift,austinzheng/swift,apple/swift,jopamer/swift,kstaring/swift,sschiau/swift,swiftix/swift,bitjammer/swift,rudkx/swift,calebd/swift,OscarSwanros/swift,devincoughlin/swift,mightydeveloper/swift,hughbe/swift,hughbe/swift,ben-ng/swift,amraboelela/swift,apple/swift,glessard/swift,jtbandes/swift,tinysun212/swift-windows,SwiftAndroid/swift,JaSpa/swift,frootloops/swift,calebd/swift,apple/swift,gmilos/swift,russbishop/swift,swiftix/swift,aschwaighofer/swift,tardieu/swift,swiftix/swift.old,atrick/swift,therealbnut/swift,rudkx/swift,tardieu/swift,OscarSwanros/swift,stephentyrone/swift,Jnosh/swift,allevato/swift,Ivacker/swift,milseman/swift,cbrentharris/swift,parkera/swift,jopamer/swift,tardieu/swift,jmgc/swift,felix91gr/swift,huonw/swift,ken0nek/swift,SwiftAndroid/swift,adrfer/swift,bitjammer/swift,kstaring/swift,JGiola/swift,kentya6/swift,stephentyrone/swift,amraboelela/swift,gmilos/swift,allevato/swift,glessard/swift,swiftix/swift.old,frootloops/swift,sdulal/swift,codestergit/swift,CodaFi/swift,khizkhiz/swift,shahmishal/swift,jtbandes/swift,shajrawi/swift,uasys/swift,xwu/swift,slavapestov/swift,manavgabhawala/swift,xedin/swift,modocache/swift,emilstahl/swift,austinzheng/swift,practicalswift/swift,codestergit/swift,sschiau/swift,karwa/swift,ben-ng/swift,danielmartin/swift,jtbandes/swift,swiftix/swift,lorentey/swift,alblue/swift,kperryua/swift,therealbnut/swift,arvedviehweger/swift,arvedviehweger/swift,sdulal/swift,amraboelela/swift,swiftix/swift.old,airspeedswift/swift,kusl/swift,glessard/swift,atrick/swift,aschwaighofer/swift,cbrentharris/swift,lorentey/swift,deyton/swift,swiftix/swift,Jnosh/swift,deyton/swift,swiftix/swift,xedin/swift,karwa/swift,JaSpa/swift,sdulal/swift,xedin/swift,CodaFi/swift,ben-ng/swift,johnno1962d/swift,OscarSwanros/swift,benlangmuir/swift,lorentey/swift,practicalswift/swift,uasys/swift,therealbnut/swift,parkera/swift,modocache/swift,kusl/swift,kstaring/swift,tjw/swift,gregomni/swift,roambotics/swift,MukeshKumarS/Swift,harlanhaskins/swift,swiftix/swift.old,JGiola/swift,return/swift,return/swift,austinzheng/swift,tardieu/swift,apple/swift,manavgabhawala/swift,sdulal/swift,hooman/swift,milseman/swift,khizkhiz/swift,hooman/swift,atrick/swift,return/swift,parkera/swift,austinzheng/swift,allevato/swift,gribozavr/swift,frootloops/swift,dduan/swift,gribozavr/swift,huonw/swift,natecook1000/swift,ken0nek/swift,sdulal/swift,hughbe/swift,amraboelela/swift,kusl/swift,milseman/swift,deyton/swift,dduan/swift,kperryua/swift,therealbnut/swift,manavgabhawala/swift,practicalswift/swift,kusl/swift,Ivacker/swift,emilstahl/swift,khizkhiz/swift,sschiau/swift,nathawes/swift,brentdax/swift,devincoughlin/swift,codestergit/swift,tjw/swift,gottesmm/swift,lorentey/swift,huonw/swift,slavapestov/swift,LeoShimonaka/swift,kperryua/swift,brentdax/swift,huonw/swift,kusl/swift,gmilos/swift,KrishMunot/swift,bitjammer/swift,gregomni/swift,djwbrown/swift,lorentey/swift,KrishMunot/swift,zisko/swift,mightydeveloper/swift,russbishop/swift,codestergit/swift,milseman/swift,Jnosh/swift,dreamsxin/swift,SwiftAndroid/swift,uasys/swift,xedin/swift,kusl/swift,djwbrown/swift,airspeedswift/swift,shajrawi/swift,natecook1000/swift,shahmishal/swift,parkera/swift,airspeedswift/swift,rudkx/swift,jopamer/swift,sdulal/swift,natecook1000/swift,IngmarStein/swift,frootloops/swift,emilstahl/swift,gottesmm/swift,shahmishal/swift,manavgabhawala/swift,nathawes/swift,JGiola/swift,devincoughlin/swift,lorentey/swift,tjw/swift,tkremenek/swift,nathawes/swift,tkremenek/swift,kentya6/swift,SwiftAndroid/swift,CodaFi/swift,harlanhaskins/swift,frootloops/swift,dduan/swift,slavapestov/swift,alblue/swift,roambotics/swift,johnno1962d/swift,johnno1962d/swift,shahmishal/swift,Ivacker/swift,IngmarStein/swift,benlangmuir/swift,CodaFi/swift,practicalswift/swift,xwu/swift,LeoShimonaka/swift,dduan/swift,modocache/swift,danielmartin/swift,cbrentharris/swift,bitjammer/swift,kstaring/swift,practicalswift/swift,tinysun212/swift-windows,milseman/swift,djwbrown/swift,airspeedswift/swift,devincoughlin/swift,KrishMunot/swift,rudkx/swift,cbrentharris/swift,gmilos/swift,devincoughlin/swift,mightydeveloper/swift,modocache/swift,adrfer/swift,roambotics/swift,emilstahl/swift,hooman/swift,nathawes/swift,karwa/swift,LeoShimonaka/swift,MukeshKumarS/Swift,alblue/swift,stephentyrone/swift,jmgc/swift,IngmarStein/swift,dduan/swift,jmgc/swift,gregomni/swift,felix91gr/swift,lorentey/swift,russbishop/swift,huonw/swift,shajrawi/swift,tardieu/swift,shajrawi/swift,danielmartin/swift,atrick/swift,xwu/swift,russbishop/swift,milseman/swift,JGiola/swift,LeoShimonaka/swift,ben-ng/swift,djwbrown/swift,hooman/swift,jopamer/swift,roambotics/swift,kentya6/swift,zisko/swift,JGiola/swift,felix91gr/swift,kperryua/swift,LeoShimonaka/swift,MukeshKumarS/Swift,johnno1962d/swift,jckarter/swift,alblue/swift,nathawes/swift,calebd/swift,hughbe/swift,therealbnut/swift,parkera/swift,Jnosh/swift,dduan/swift,frootloops/swift,ahoppen/swift,shahmishal/swift,devincoughlin/swift,jckarter/swift,modocache/swift,cbrentharris/swift,brentdax/swift,airspeedswift/swift,zisko/swift,MukeshKumarS/Swift,tardieu/swift,hooman/swift,djwbrown/swift,benlangmuir/swift,karwa/swift,deyton/swift,gribozavr/swift,Ivacker/swift,rudkx/swift,aschwaighofer/swift,emilstahl/swift,benlangmuir/swift,deyton/swift,gottesmm/swift,aschwaighofer/swift,OscarSwanros/swift,atrick/swift,stephentyrone/swift,slavapestov/swift,adrfer/swift,alblue/swift,brentdax/swift,mightydeveloper/swift,calebd/swift,allevato/swift,sdulal/swift,zisko/swift,emilstahl/swift,danielmartin/swift,kstaring/swift,SwiftAndroid/swift,jckarter/swift,ahoppen/swift,sdulal/swift,MukeshKumarS/Swift,jckarter/swift,gottesmm/swift,jopamer/swift,roambotics/swift,hughbe/swift,sschiau/swift,xedin/swift,IngmarStein/swift,shajrawi/swift,kentya6/swift,devincoughlin/swift,johnno1962d/swift,codestergit/swift,brentdax/swift,zisko/swift,adrfer/swift,khizkhiz/swift,kperryua/swift,felix91gr/swift,OscarSwanros/swift,shahmishal/swift,ken0nek/swift,tinysun212/swift-windows,gribozavr/swift,harlanhaskins/swift,tinysun212/swift-windows,mightydeveloper/swift,kentya6/swift,IngmarStein/swift,austinzheng/swift,danielmartin/swift,hughbe/swift,aschwaighofer/swift,airspeedswift/swift,Ivacker/swift,austinzheng/swift,JaSpa/swift,huonw/swift,tinysun212/swift-windows,deyton/swift,shahmishal/swift,arvedviehweger/swift,modocache/swift,ben-ng/swift,arvedviehweger/swift,gregomni/swift,bitjammer/swift,khizkhiz/swift,gregomni/swift,kstaring/swift,gribozavr/swift,karwa/swift,swiftix/swift.old,stephentyrone/swift,parkera/swift,danielmartin/swift,swiftix/swift.old,parkera/swift,CodaFi/swift,KrishMunot/swift,tkremenek/swift,tinysun212/swift-windows,MukeshKumarS/Swift,codestergit/swift,IngmarStein/swift,jtbandes/swift,return/swift,emilstahl/swift,huonw/swift,jopamer/swift,djwbrown/swift,ahoppen/swift,natecook1000/swift,jtbandes/swift,sschiau/swift,amraboelela/swift,adrfer/swift,modocache/swift,jtbandes/swift,swiftix/swift.old,manavgabhawala/swift,brentdax/swift,allevato/swift,uasys/swift,apple/swift,russbishop/swift,practicalswift/swift,allevato/swift,kusl/swift,jmgc/swift,ken0nek/swift,IngmarStein/swift,JGiola/swift,sschiau/swift,return/swift,natecook1000/swift,atrick/swift,KrishMunot/swift,shajrawi/swift,gribozavr/swift,natecook1000/swift,arvedviehweger/swift,gmilos/swift,harlanhaskins/swift,kentya6/swift,gmilos/swift,tkremenek/swift,kstaring/swift,johnno1962d/swift,JaSpa/swift,lorentey/swift,JaSpa/swift,jckarter/swift,devincoughlin/swift,frootloops/swift,glessard/swift,benlangmuir/swift,xwu/swift,xedin/swift,amraboelela/swift,xwu/swift,slavapestov/swift,uasys/swift,tjw/swift,practicalswift/swift,JaSpa/swift,sschiau/swift,stephentyrone/swift,ben-ng/swift,manavgabhawala/swift,slavapestov/swift,kperryua/swift,kentya6/swift,MukeshKumarS/Swift,arvedviehweger/swift,tinysun212/swift-windows,austinzheng/swift,natecook1000/swift,jmgc/swift,Jnosh/swift,milseman/swift,stephentyrone/swift,brentdax/swift,bitjammer/swift,nathawes/swift,xedin/swift,aschwaighofer/swift,jmgc/swift,shajrawi/swift,tjw/swift,jckarter/swift,karwa/swift,gottesmm/swift,shajrawi/swift,kentya6/swift,manavgabhawala/swift,calebd/swift,apple/swift,OscarSwanros/swift,gottesmm/swift,bitjammer/swift,cbrentharris/swift,mightydeveloper/swift,slavapestov/swift,xwu/swift,KrishMunot/swift,Ivacker/swift,zisko/swift,djwbrown/swift,KrishMunot/swift,alblue/swift,aschwaighofer/swift,roambotics/swift,calebd/swift,airspeedswift/swift,amraboelela/swift,ken0nek/swift,swiftix/swift.old,gribozavr/swift,deyton/swift,xedin/swift,xwu/swift,cbrentharris/swift,LeoShimonaka/swift,felix91gr/swift,hooman/swift,allevato/swift,harlanhaskins/swift,jckarter/swift,gmilos/swift,adrfer/swift,rudkx/swift,ben-ng/swift,ken0nek/swift,mightydeveloper/swift,LeoShimonaka/swift,russbishop/swift,uasys/swift,Ivacker/swift,glessard/swift,benlangmuir/swift,harlanhaskins/swift,ahoppen/swift,alblue/swift,karwa/swift,arvedviehweger/swift,tardieu/swift,CodaFi/swift,practicalswift/swift,therealbnut/swift,felix91gr/swift,glessard/swift,kperryua/swift,tjw/swift,khizkhiz/swift,Ivacker/swift,nathawes/swift,karwa/swift,felix91gr/swift,jmgc/swift,khizkhiz/swift,mightydeveloper/swift,uasys/swift,ahoppen/swift,adrfer/swift,tjw/swift,dreamsxin/swift,hughbe/swift,swiftix/swift