summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAditya Kumar <hiraditya@msn.com>2016-09-26 21:01:13 +0000
committerAditya Kumar <hiraditya@msn.com>2016-09-26 21:01:13 +0000
commit0a48b37cfdb69fdbdc799e2754124338c721e5dc (patch)
tree63514a747831dcc2adf21700d68ed5c3ab20b533 /llvm/lib
parentc24e6dd3c8a0930b921388e9ce175afd5330eeaf (diff)
downloadbcm5719-llvm-0a48b37cfdb69fdbdc799e2754124338c721e5dc.tar.gz
bcm5719-llvm-0a48b37cfdb69fdbdc799e2754124338c721e5dc.zip
Move computation past early return
Reviewers: rafael spatel Differential Revision: https://reviews.llvm.org/D24843 llvm-svn: 282440
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Metadata.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 51ef2fad7ef..d4312c8b253 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -1154,14 +1154,13 @@ MDNode *Instruction::getMetadataImpl(StringRef Kind) const {
}
void Instruction::dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs) {
- SmallSet<unsigned, 5> KnownSet;
- KnownSet.insert(KnownIDs.begin(), KnownIDs.end());
-
if (!hasMetadataHashEntry())
return; // Nothing to remove!
auto &InstructionMetadata = getContext().pImpl->InstructionMetadata;
+ SmallSet<unsigned, 4> KnownSet;
+ KnownSet.insert(KnownIDs.begin(), KnownIDs.end());
if (KnownSet.empty()) {
// Just drop our entry at the store.
InstructionMetadata.erase(this);
OpenPOWER on IntegriCloud