vfdff wrote: > I think this should be a minor generalization of some existing simplifyWithOpReplaced or foldSelectValueEquivalence style fold. Thanks, refactor with simplifyWithOpReplaced. (foldSelectValueEquivalence is used for **select + cmp**) https://github.com/llvm/llvm-project/pull/83405