commit | 0c8f3f9332929b12c0f81dcf07169c1869098c3b | [log] [tgz] |
---|---|---|
author | Sanjay Patel <spatel@rotateright.com> | Fri May 13 17:28:12 2016 +0000 |
committer | Sanjay Patel <spatel@rotateright.com> | Fri May 13 17:28:12 2016 +0000 |
tree | 5dc927ce2f023135d6d4b8e7a8fef592fb6466fe | |
parent | 27dba61ff313d68c9c3dcb2ea3f769477a8b789e [diff] [blame] |
[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
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index acc03e7..e06ec39 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -3130,8 +3130,9 @@ } // 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();