tschuett wrote: X86 lowers them sometimes into selects. We could add the reverse combine: // abds(lhs, rhs) -> select(slt(lhs,rhs),sub(rhs,lhs),sub(lhs,rhs)) // abdu(lhs, rhs) -> select(ult(lhs,rhs),sub(rhs,lhs),sub(lhs,rhs)) https://github.com/llvm/llvm-project/pull/118122