[llvm] r282440 - Move computation past early return
Aditya Kumar via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 26 14:01:13 PDT 2016
Author: hiraditya
Date: Mon Sep 26 16:01:13 2016
New Revision: 282440
URL: http://llvm.org/viewvc/llvm-project?rev=282440&view=rev
Log:
Move computation past early return
Reviewers:
rafael
spatel
Differential Revision: https://reviews.llvm.org/D24843
Modified:
llvm/trunk/lib/IR/Metadata.cpp
Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=282440&r1=282439&r2=282440&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Mon Sep 26 16:01:13 2016
@@ -1154,14 +1154,13 @@ MDNode *Instruction::getMetadataImpl(Str
}
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);
More information about the llvm-commits
mailing list