[llvm] 8f0a8ed - [InjectTLIMappings] Use StringRef instead of std::string for FN name.

Nadav Rotem via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 11:53:23 PDT 2020


Author: Nadav Rotem
Date: 2020-07-16T11:53:04-07:00
New Revision: 8f0a8ed44e27c694b3b32721f913f32048564e5e

URL: https://github.com/llvm/llvm-project/commit/8f0a8ed44e27c694b3b32721f913f32048564e5e
DIFF: https://github.com/llvm/llvm-project/commit/8f0a8ed44e27c694b3b32721f913f32048564e5e.diff

LOG: [InjectTLIMappings] Use StringRef instead of std::string for FN name.

https://reviews.llvm.org/D83797

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp b/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp
index 9d8f59d62d6d..0c43c1e1ac2a 100644
--- a/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp
+++ b/llvm/lib/Transforms/Utils/InjectTLIMappings.cpp
@@ -77,7 +77,8 @@ static void addMappingsFromTLI(const TargetLibraryInfo &TLI, CallInst &CI) {
   if (CI.isNoBuiltin() || !CI.getCalledFunction())
     return;
 
-  const std::string ScalarName = std::string(CI.getCalledFunction()->getName());
+  StringRef ScalarName = CI.getCalledFunction()->getName();
+
   // Nothing to be done if the TLI thinks the function is not
   // vectorizable.
   if (!TLI.isFunctionVectorizable(ScalarName))


        


More information about the llvm-commits mailing list