summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-08-02 14:33:40 +0000
committerSanjay Patel <spatel@rotateright.com>2018-08-02 14:33:40 +0000
commit3f6e9a71f7dee5e44b5d6dae16d7a31163f9d7c1 (patch)
tree2b3c0f363b6851247a66fa8aac249831eaf60b7b /llvm/lib/Analysis/InstructionSimplify.cpp
parenta7dbe571e686f3a8f0d97715a82a6dc648a8d3db (diff)
downloadbcm5719-llvm-3f6e9a71f7dee5e44b5d6dae16d7a31163f9d7c1.tar.gz
bcm5719-llvm-3f6e9a71f7dee5e44b5d6dae16d7a31163f9d7c1.zip
[InstSimplify] move minnum/maxnum with undef fold from instcombine
llvm-svn: 338719
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index b1601bfe1b2..ffdbfc45c84 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -4767,9 +4767,10 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1,
// If the arguments are the same, this is a no-op.
if (Op0 == Op1) return Op0;
- // If one argument is NaN, return the other argument.
- if (match(Op0, m_NaN())) return Op1;
- if (match(Op1, m_NaN())) return Op0;
+ // If one argument is NaN or undef, return the other argument.
+ if (match(Op0, m_CombineOr(m_NaN(), m_Undef()))) return Op1;
+ if (match(Op1, m_CombineOr(m_NaN(), m_Undef()))) return Op0;
+
break;
default:
break;
OpenPOWER on IntegriCloud