If we can ignore NaNs, fmin/fmax libcalls can become compare and select (this is what we turn std::min / std::max into).
This IR should then be optimized in the backend to whatever is best for any given target. Eg, x86 can use minss/maxss instructions.
This should solve PR24314:
https://llvm.org/bugs/show_bug.cgi?id=24314