Hello, this is a reattempt to push the Switch To Select optimization for switches with only two cases
This is the fix for this patch http://reviews.llvm.org/D5620 that assumed that PHIs should never have multiple incoming edges from the same block , but even if the IR Verifier enforces this condition, it seems to be not followed in the code in SimplifyCFG where it is actually expected by certain optimizations.
This patch makes sure this code follows that convention as well.
This is the only thing that changed from the previous patch, with this becoming a "while" from an "if"