[PATCH] D47188: Intel SVML calling conventions

Denis Nagorny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 02:36:29 PDT 2018


dvnagorny added inline comments.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:55
+  std::string FullName = FnName;
+  return IsFast ? FullName : FullName + "_ha";
+}
----------------
lebedev.ri wrote:
> dvnagorny wrote:
> > lebedev.ri wrote:
> > > This memory allocation looks unfortunate :/
> > Could you explain your comment more detailed please. svmlMangle() returns not a reference but the std::string.
> Not much to explain, that already summarizes it quite well.
> 
> It will return a `std::string`, not a reference, 
> so unless small string optimization within `std::string`
> happens, every call to `svmlMangle()` will cause an allocation.
> 
> And this also caused `getVectorizedFunction()` to return
> the `std:;string`, and so on.
I can't agree with you here. Beside of RVO we have move semantics for std::string now. So there shouldn't be no any extra memory allocations. Does LLVM coding standard imply anything special on move semantics?


Repository:
  rL LLVM

https://reviews.llvm.org/D47188





More information about the llvm-commits mailing list