summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-06 07:13:13 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-06 07:13:13 +0000
commit2dfb4804f27a3ce5ba5e96e81a4825c3b1760059 (patch)
tree2f4cae5167d25af07e85e22a828ee61ba3275b3a /llvm
parent8e662f7f815dcfe04e920c2d022d963524d05d2c (diff)
downloadbcm5719-llvm-2dfb4804f27a3ce5ba5e96e81a4825c3b1760059.tar.gz
bcm5719-llvm-2dfb4804f27a3ce5ba5e96e81a4825c3b1760059.zip
[InstSimplify] Use the getTrue/getFalse helpers and make sure we use the computed result type instead of hardcoding to i1. NFC
Currently, isKnownNonEqual punts on vectors so the hardcoding to i1 doesn't matter. But I plan to fix that in a future patch. llvm-svn: 304773
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index d5b93caf714..55ced969d13 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -3310,9 +3310,7 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
// icmp eq|ne X, Y -> false|true if X != Y
if (ICmpInst::isEquality(Pred) &&
isKnownNonEqual(LHS, RHS, Q.DL, Q.AC, Q.CxtI, Q.DT)) {
- LLVMContext &Ctx = LHS->getType()->getContext();
- return Pred == ICmpInst::ICMP_NE ?
- ConstantInt::getTrue(Ctx) : ConstantInt::getFalse(Ctx);
+ return Pred == ICmpInst::ICMP_NE ? getTrue(ITy) : getFalse(ITy);
}
if (Value *V = simplifyICmpWithBinOp(Pred, LHS, RHS, Q, MaxRecurse))
OpenPOWER on IntegriCloud