[Openmp-commits] [PATCH] D71989: [OpenMP][IRBuilder] `omp task` support

Shraiysh via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue May 3 02:19:09 PDT 2022


shraiysh added inline comments.


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:1355
+    FunctionCallee WrapperFuncVal = M.getOrInsertFunction(
+        WrapperFuncName.toStringRef(WrapperFuncNameStorage),
+        FunctionType::get(Builder.getInt32Ty(), WrapperArgTys, false));
----------------
Meinersbur wrote:
> No `SmallString<128>` needed.  `str()` creates a `std::string` that implicitly converts to a `llvm::StringRef` that is valid until the end of the statement(`"`;`"`).
> 
> Compared to using `std::string` only, this saves the creation of one temporary `std::sting` (for `OutlinedFn.getName()`). Your version saves another one (if fewer than 128 chars), but it is also more complicated. Before `StringRef` was made more compatible to `std::string_view`, the `.str()` wasn't even need.
> 
Alright, thanks for the explanation, I understand it better now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71989



More information about the Openmp-commits mailing list