[InstCombine]PtrReplacer: Correctly handle select with unavailable operands (#148829) (#19908)
The testcase I added previously failed because a SelectInst with invalid
operands was created (one side `addrspace(4)`, the other
`addrspace(5)`).
PointerReplacer needs to dig deeper if the true and/or false
instructions of the select are not available.
Fixes SWDEV-542957
(cherry picked from commit f223411e2e005ecd54523801db603b54d69f3159)
Co-authored-by: Pierre van Houtryve <pierre.vanhoutryve@amd.com>