Don't do (X != Y) ? X : Y -> X for floating-point values; it doesn't
authorDan Gohman <gohman@apple.com>
Tue, 23 Feb 2010 17:17:57 +0000 (17:17 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 23 Feb 2010 17:17:57 +0000 (17:17 +0000)
commit21dc20cbd62e0b4617cad7df947318801eec81e6
tree0768ad5fb0a559f94f1154e57c5dfa40e61f4ebb
parentcf453ee70a1ae03cc641686fd5db0f8a7d8ce250
Don't do (X != Y) ? X : Y  -> X for floating-point values; it doesn't
handle NaN properly.

Do (X une Y) ? X : Y  -> X if one of X and Y is not zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96955 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/fcmp-select.ll [new file with mode: 0644]