fhahn wrote: I also shared another variant to vectorize maxnum/minnum (used by std::fmax/std::fmin) in https://github.com/llvm/llvm-project/pull/148239. That one is slightly less code and may be good to review first https://github.com/llvm/llvm-project/pull/146711