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
Actually, why do we need no NaNs? We don't support FP exceptions, so we only need to do the correct thing with NaN arguments (by returning the non-NaN). This should be easy to guarantee by picking the right ordered vs. unordered fcmp predicate.