[PATCH] D57726: [SamplePGO][NFC] Minor improvement to replace a temporary vector with a brace-enclosed init list

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 4 16:57:52 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL353129: [SamplePGO][NFC] Minor improvement to replace a temporary vector with a (authored by wmi, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57726?vs=185192&id=185194#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57726/new/

https://reviews.llvm.org/D57726

Files:
  llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp


Index: llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
+++ llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
@@ -1327,9 +1327,8 @@
                             SortedCallTargets, Sum, IPVK_IndirectCallTarget,
                             SortedCallTargets.size());
         } else if (!dyn_cast<IntrinsicInst>(&I)) {
-          SmallVector<uint32_t, 1> Weights;
-          Weights.push_back(BlockWeights[BB]);
-          I.setMetadata(LLVMContext::MD_prof, MDB.createBranchWeights(Weights));
+          I.setMetadata(LLVMContext::MD_prof,
+                        MDB.createBranchWeights({BlockWeights[BB]}));
         }
       }
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57726.185194.patch
Type: text/x-patch
Size: 755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190205/ed901ed2/attachment.bin>


More information about the llvm-commits mailing list