[PATCH] D101503: [OpenMPIRBuilder] Add createOffloadMaptypes and createOffloadMapnames functions

Michael Kruse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 29 21:43:35 PDT 2021


Meinersbur added a comment.

testcase <https://reviews.llvm.org/file/data/x7ek55ermhuir7scj6js/PHID-FILE-rv6yqg4slwt4wjhljdjz/meme-test_case>

That is, something that calls createOffloadMaptypes/createOffloadMapnames independently of any front-end. Can be as simply as calling it and checking that the returned variable has the expected type and name.



================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:9378
     // fill arrays. Instead, we create an array constant.
-    SmallVector<uint64_t, 4> Mapping(CombinedInfo.Types.size(), 0);
     llvm::copy(CombinedInfo.Types, Mapping.begin());
----------------
With SmallVectorImpl for createOffloadMaptypes, this change is not necessary anymore


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:9400
       };
-      SmallVector<llvm::Constant *, 4> InfoMap(CombinedInfo.Exprs.size());
       llvm::transform(CombinedInfo.Exprs, InfoMap.begin(), fillInfoMap);
----------------
With SmallVectorImpl for createOffloadMapnames, this change is not necessary anymore


================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:619
+  /// Create the global variable holding the offload mappings information.
+  GlobalVariable *createOffloadMaptypes(SmallVector<uint64_t> &Mappings,
+                                        std::string VarName);
----------------
Use SmallVectorImpl


================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:623
+  /// Create the global variable holding the offload names information.
+  GlobalVariable *createOffloadMapnames(SmallVector<llvm::Constant *> &Names,
+                                        std::string VarName);
----------------
Use SmallVectorImpl


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:2098
 
+// Create the global variable holding the offload mappings information.
+GlobalVariable *
----------------
A description at the declaration is sufficient


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101503



More information about the cfe-commits mailing list