[PATCH] D24843: Move computation past early return

Aditya Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 14:10:13 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL282440: Move computation past early return (authored by hiraditya).

Changed prior to commit:
  https://reviews.llvm.org/D24843?vs=72209&id=72564#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24843

Files:
  llvm/trunk/lib/IR/Metadata.cpp

Index: llvm/trunk/lib/IR/Metadata.cpp
===================================================================
--- llvm/trunk/lib/IR/Metadata.cpp
+++ llvm/trunk/lib/IR/Metadata.cpp
@@ -1154,14 +1154,13 @@
 }
 
 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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24843.72564.patch
Type: text/x-patch
Size: 713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160926/f6dd4c10/attachment.bin>


More information about the llvm-commits mailing list