aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine/InstCombineSelect.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-11 11:37:40 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-11 11:37:40 +0000
commit6b4972518cff5b0f76ec63fc8b93b74ae64c3f3d (patch)
tree7ac5243accfb041a85b0de85e7f9d5a4ae976bb5 /lib/Transforms/InstCombine/InstCombineSelect.cpp
parentb69050a94c1c9266ab048a79c8375e5b14d87c72 (diff)
downloadexternal_llvm-6b4972518cff5b0f76ec63fc8b93b74ae64c3f3d.zip
external_llvm-6b4972518cff5b0f76ec63fc8b93b74ae64c3f3d.tar.gz
external_llvm-6b4972518cff5b0f76ec63fc8b93b74ae64c3f3d.tar.bz2
InstCombine: Fix a thinko where transform an icmp under the assumption that it's a zero comparison when it's not.
Fixes PR9454. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineSelect.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineSelect.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineSelect.cpp b/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 97abc76..8b9261b 100644
--- a/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -503,9 +503,8 @@ static Value *foldSelectICmpAnd(const SelectInst &SI, ConstantInt *TrueVal,
if (!IC || !IC->isEquality())
return 0;
- if (ConstantInt *C = dyn_cast<ConstantInt>(IC->getOperand(1)))
- if (!C->isZero())
- return 0;
+ if (!match(IC->getOperand(1), m_Zero()))
+ return 0;
ConstantInt *AndRHS;
Value *LHS = IC->getOperand(0);