summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-05-13 17:28:12 +0000
committerSanjay Patel <spatel@rotateright.com>2016-05-13 17:28:12 +0000
commit0c8f3f9332929b12c0f81dcf07169c1869098c3b (patch)
tree5dc927ce2f023135d6d4b8e7a8fef592fb6466fe /llvm/lib
parent27dba61ff313d68c9c3dcb2ea3f769477a8b789e (diff)
downloadbcm5719-llvm-0c8f3f9332929b12c0f81dcf07169c1869098c3b.tar.gz
bcm5719-llvm-0c8f3f9332929b12c0f81dcf07169c1869098c3b.zip
[InstCombine] handle zero constant vectors for LE/GE comparisons too
Enhancement to: http://reviews.llvm.org/rL269426 With discussion in: http://reviews.llvm.org/D17859 This should complete the fixes for: PR26701, PR26819: https://llvm.org/bugs/show_bug.cgi?id=26701 https://llvm.org/bugs/show_bug.cgi?id=26819 llvm-svn: 269439
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index acc03e722f0..e06ec3945e3 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -3130,8 +3130,9 @@ static ICmpInst *canonicalizeCmpWithConstant(ICmpInst &I,
}
// The usual vector types are ConstantDataVector. Exotic vector types are
- // ConstantVector. They both derive from Constant.
- if (isa<ConstantDataVector>(Op1) || isa<ConstantVector>(Op1)) {
+ // ConstantVector. Zeros are special. They all derive from Constant.
+ if (isa<ConstantDataVector>(Op1) || isa<ConstantVector>(Op1) ||
+ isa<ConstantAggregateZero>(Op1)) {
Constant *Op1C = cast<Constant>(Op1);
Type *Op1Type = Op1->getType();
unsigned NumElts = Op1Type->getVectorNumElements();
OpenPOWER on IntegriCloud