summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-04 22:41:56 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-04 22:41:56 +0000
commitda8037f299b9819aa54495c43d6fc80372dade9c (patch)
tree4de6903a1660488020fe3f32f3c88ab774d35ed3
parentf27f51de4362343d1b732a33488d72a87d184aae (diff)
downloadbcm5719-llvm-da8037f299b9819aa54495c43d6fc80372dade9c.tar.gz
bcm5719-llvm-da8037f299b9819aa54495c43d6fc80372dade9c.zip
[InstSimplify] Use llvm::all_of instead of a manual loop. NFC
llvm-svn: 304692
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 66ac847455c..c19af1b5ff7 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -3896,9 +3896,8 @@ static Value *SimplifyGEPInst(Type *SrcTy, ArrayRef<Value *> Ops,
}
// Check to see if this is constant foldable.
- for (unsigned i = 0, e = Ops.size(); i != e; ++i)
- if (!isa<Constant>(Ops[i]))
- return nullptr;
+ if (!all_of(Ops, [](Value *V) { return isa<Constant>(V); }))
+ return nullptr;
return ConstantExpr::getGetElementPtr(SrcTy, cast<Constant>(Ops[0]),
Ops.slice(1));
OpenPOWER on IntegriCloud