arsenm wrote: I'm not sure this plays well with the generic DAGCombiner. It prefers fminimum/fmaximum over the others when available; it might be better to just add this as an alternative pattern based on the flag https://github.com/llvm/llvm-project/pull/142217