Fix logic error in previous commit. The != case needs to become an or, not an
and.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92419 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index e208d69..50e9f24 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7324,9 +7324,13 @@
Constant::getNullValue(P->getType()));
Value *ICIQ = Builder->CreateICmp(ICI.getPredicate(), Q,
Constant::getNullValue(Q->getType()));
- Instruction *And = BinaryOperator::CreateAnd(ICIP, ICIQ, "");
- And->takeName(&ICI);
- return And;
+ Instruction *Op;
+ if (ICI.getPredicate() == ICmpInst::ICMP_EQ)
+ Op = BinaryOperator::CreateAnd(ICIP, ICIQ, "");
+ else
+ Op = BinaryOperator::CreateOr(ICIP, ICIQ, "");
+ Op->takeName(&ICI);
+ return Op;
}
break;
}