This is implemented with more general rules:
X op (C ? P : Q) -> C ? (X op P) : (X op Q)
// if X op P and X op Q both simplify
(C ? P : Q) op Y -> C ? (P op Y) : (Q op Y)
// if P op Y and Q op Y both simplify
The tests include some other cases where these more general rules apply.
Question to reviewers: would it be better to enhance SimplifyQuery / InstrInfoQuery to know about fast math flags, so that I don't have to pass FMF around explicitly?