diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-06-02 16:29:41 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-06-02 16:29:41 +0000 |
commit | ce241f48c52c2ae5f7fd3821ad2a8431e1be6117 (patch) | |
tree | 6b75f2e7580e74874343cc2df9f158f6cff57787 /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | |
parent | d249e4a188a6e5448e19f61597b00e1b989c7376 (diff) | |
download | bcm5719-llvm-ce241f48c52c2ae5f7fd3821ad2a8431e1be6117.tar.gz bcm5719-llvm-ce241f48c52c2ae5f7fd3821ad2a8431e1be6117.zip |
[InstCombine] fix icmp with not op and constant to work with splat vector constant
llvm-svn: 304562
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 4ca967d3afb..c0798e164c3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -4514,10 +4514,10 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (match(Op1, m_Not(m_Value(B)))) return new ICmpInst(I.getPredicate(), B, A); - // FIXME: Use m_APInt to include splat vector constants. - if (ConstantInt *RHSC = dyn_cast<ConstantInt>(Op1)) + const APInt *C; + if (match(Op1, m_APInt(C))) return new ICmpInst(I.getSwappedPredicate(), A, - ConstantExpr::getNot(RHSC)); + ConstantInt::get(Op1->getType(), ~(*C))); } Instruction *AddI = nullptr; |