summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/VectorUtils.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-07-06 18:39:47 +0000
committerCraig Topper <craig.topper@intel.com>2017-07-06 18:39:47 +0000
commit79ab643da842b03da893a0188426450525e6ada5 (patch)
tree6a1a91dac806eca4ea8b6b95373193626e0d94a6 /llvm/lib/Analysis/VectorUtils.cpp
parenteb6d5d19508c5485aafb7f9a30dee819a3b64352 (diff)
downloadbcm5719-llvm-79ab643da842b03da893a0188426450525e6ada5.tar.gz
bcm5719-llvm-79ab643da842b03da893a0188426450525e6ada5.zip
[Constants] If we already have a ConstantInt*, prefer to use isZero/isOne/isMinusOne instead of isNullValue/isOneValue/isAllOnesValue inherited from Constant. NFCI
Going through the Constant methods requires redetermining that the Constant is a ConstantInt and then calling isZero/isOne/isMinusOne. llvm-svn: 307292
Diffstat (limited to 'llvm/lib/Analysis/VectorUtils.cpp')
-rw-r--r--llvm/lib/Analysis/VectorUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 0ace8fa382b..554d132c2ab 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -301,7 +301,7 @@ const llvm::Value *llvm::getSplatValue(const Value *V) {
auto *InsertEltInst =
dyn_cast<InsertElementInst>(ShuffleInst->getOperand(0));
if (!InsertEltInst || !isa<ConstantInt>(InsertEltInst->getOperand(2)) ||
- !cast<ConstantInt>(InsertEltInst->getOperand(2))->isNullValue())
+ !cast<ConstantInt>(InsertEltInst->getOperand(2))->isZero())
return nullptr;
return InsertEltInst->getOperand(1);
OpenPOWER on IntegriCloud