[PATCH] D83797: Remove thousands of std::string instances in a helper function that is frequently called.

Nadav Rotem via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 11:19:32 PDT 2020


nadav updated this revision to Diff 277912.

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

https://reviews.llvm.org/D83797

Files:
  llvm/lib/Transforms/Utils/InjectTLIMappings.cpp


Index: llvm/lib/Transforms/Utils/InjectTLIMappings.cpp
===================================================================
--- llvm/lib/Transforms/Utils/InjectTLIMappings.cpp
+++ llvm/lib/Transforms/Utils/InjectTLIMappings.cpp
@@ -77,11 +77,13 @@
   if (CI.isNoBuiltin() || !CI.getCalledFunction())
     return;
 
-  const std::string ScalarName = std::string(CI.getCalledFunction()->getName());
+  auto ScalarName = CI.getCalledFunction()->getName();
+
   // Nothing to be done if the TLI thinks the function is not
   // vectorizable.
   if (!TLI.isFunctionVectorizable(ScalarName))
     return;
+
   SmallVector<std::string, 8> Mappings;
   VFABI::getVectorVariantNames(CI, Mappings);
   Module *M = CI.getModule();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83797.277912.patch
Type: text/x-patch
Size: 719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200714/170f987f/attachment.bin>


More information about the llvm-commits mailing list