This patch attempts to determine the result of a select based on a dominating condition. This is similar to what is done in JumpThreading and SimplifyCFG, except those passes only consider conditional branches and not selects.
AFAICT, the transformation in pr21210.ll is safe, but the comments in the lit test seem to indicate otherwise.
@Gerolf - Would you mind helping me better understand what pr21210.ll is trying to test?
I didn't run into any correctness issues with the test-suite or SPEC200X.
This also addresses PR23333.
Please take a look,