[SILOptimizer] Avoid UB in EagerSpecializer
[SILOptimizer] Avoid UB in EagerSpecializer

Previously, the EagerSpecializer pass would sometimes call a method on a null CanSpecializedGenericSignature. The method happened to never touch `this` if it was null, but UBSan still considers the call to be undefined behavior.

This change tests for the condition ahead of time and manually implements equivalent behavior without calling the method.

apple/swift,atrick/swift,shajrawi/swift,xedin/swift,karwa/swift,nathawes/swift,sschiau/swift,apple/swift,xwu/swift,roambotics/swift,karwa/swift,jckarter/swift,xedin/swift,tkremenek/swift,JGiola/swift,stephentyrone/swift,danielmartin/swift,rudkx/swift,nathawes/swift,roambotics/swift,gregomni/swift,rudkx/swift,lorentey/swift,practicalswift/swift,harlanhaskins/swift,shahmishal/swift,jckarter/swift,JGiola/swift,practicalswift/swift,jmgc/swift,sschiau/swift,xwu/swift,practicalswift/swift,gregomni/swift,shajrawi/swift,hooman/swift,tkremenek/swift,austinzheng/swift,xwu/swift,airspeedswift/swift,alblue/swift,gribozavr/swift,CodaFi/swift,glessard/swift,glessard/swift,sschiau/swift,aschwaighofer/swift,atrick/swift,tkremenek/swift,alblue/swift,brentdax/swift,roambotics/swift,JGiola/swift,austinzheng/swift,parkera/swift,xedin/swift,CodaFi/swift,benlangmuir/swift,lorentey/swift,parkera/swift,xedin/swift,xedin/swift,shahmishal/swift,sschiau/swift,xedin/swift,practicalswift/swift,jckarter/swift,parkera/swift,airspeedswift/swift,jmgc/swift,natecook1000/swift,aschwaighofer/swift,roambotics/swift,glessard/swift,practicalswift/swift,rudkx/swift,brentdax/swift,danielmartin/swift,practicalswift/swift,shahmishal/swift,jmgc/swift,brentdax/swift,stephentyrone/swift,parkera/swift,devincoughlin/swift,tkremenek/swift,devincoughlin/swift,devincoughlin/swift,roambotics/swift,shajrawi/swift,xwu/swift,gribozavr/swift,glessard/swift,harlanhaskins/swift,karwa/swift,jmgc/swift,ahoppen/swift,allevato/swift,aschwaighofer/swift,danielmartin/swift,parkera/swift,apple/swift,airspeedswift/swift,hooman/swift,CodaFi/swift,alblue/swift,lorentey/swift,allevato/swift,karwa/swift,amraboelela/swift,parkera/swift,roambotics/swift,atrick/swift,stephentyrone/swift,CodaFi/swift,tkremenek/swift,lorentey/swift,karwa/swift,gribozavr/swift,brentdax/swift,jmgc/swift,shajrawi/swift,nathawes/swift,natecook1000/swift,xedin/swift,glessard/swift,aschwaighofer/swift,gribozavr/swift,benlangmuir/swift,austinzheng/swift,natecook1000/swift,glessard/swift,allevato/swift,natecook1000/swift,gregomni/swift,brentdax/swift,apple/swift,stephentyrone/swift,harlanhaskins/swift,devincoughlin/swift,CodaFi/swift,rudkx/swift,lorentey/swift,parkera/swift,aschwaighofer/swift,airspeedswift/swift,harlanhaskins/swift,lorentey/swift,sschiau/swift,allevato/swift,nathawes/swift,harlanhaskins/swift,atrick/swift,shajrawi/swift,allevato/swift,lorentey/swift,natecook1000/swift,CodaFi/swift,stephentyrone/swift,natecook1000/swift,shahmishal/swift,alblue/swift,airspeedswift/swift,devincoughlin/swift,harlanhaskins/swift,gribozavr/swift,practicalswift/swift,jckarter/swift,danielmartin/swift,sschiau/swift,amraboelela/swift,JGiola/swift,apple/swift,shajrawi/swift,jmgc/swift,gregomni/swift,ahoppen/swift,harlanhaskins/swift,allevato/swift,devincoughlin/swift,rudkx/swift,benlangmuir/swift,hooman/swift,devincoughlin/swift,amraboelela/swift,gregomni/swift,brentdax/swift,xwu/swift,karwa/swift,shajrawi/swift,amraboelela/swift,ahoppen/swift,airspeedswift/swift,karwa/swift,gregomni/swift,atrick/swift,ahoppen/swift,jmgc/swift,gribozavr/swift,brentdax/swift,danielmartin/swift,aschwaighofer/swift,xwu/swift,austinzheng/swift,nathawes/swift,hooman/swift,ahoppen/swift,hooman/swift,stephentyrone/swift,ahoppen/swift,shahmishal/swift,benlangmuir/swift,sschiau/swift,danielmartin/swift,danielmartin/swift,practicalswift/swift,devincoughlin/swift,apple/swift,rudkx/swift,CodaFi/swift,tkremenek/swift,austinzheng/swift,benlangmuir/swift,sschiau/swift,hooman/swift,JGiola/swift,natecook1000/swift,benlangmuir/swift,austinzheng/swift,alblue/swift,amraboelela/swift,airspeedswift/swift,aschwaighofer/swift,jckarter/swift,karwa/swift,xedin/swift,lorentey/swift,atrick/swift,jckarter/swift,hooman/swift,shahmishal/swift,shajrawi/swift,parkera/swift,allevato/swift,JGiola/swift,nathawes/swift,tkremenek/swift,gribozavr/swift,amraboelela/swift,alblue/swift,gribozavr/swift,shahmishal/swift,austinzheng/swift,alblue/swift,nathawes/swift,stephentyrone/swift,amraboelela/swift,jckarter/swift,xwu/swift,shahmishal/swift