transform fmin/fmax calls when possible (PR24314)
authorSanjay Patel <spatel@rotateright.com>
Sun, 16 Aug 2015 20:18:19 +0000 (20:18 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 16 Aug 2015 20:18:19 +0000 (20:18 +0000)
commit69ab373dfec278c50957ac1be5331b20a05d1334
treea49fa739749fd83a6bf50839a1cb83b96f80e1a4
parent334643759f47e54af4f3974c7ad0953db946c862
transform fmin/fmax calls when possible (PR24314)

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

Differential Revision: http://reviews.llvm.org/D11866

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245187 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/fast-math.ll