[PATCH] D149872: [OpenMP][OMPIRBuilder] Migrate emitOffloadingArrays and EmitNonContiguousDescriptor from Clang

Jan Sjödin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 12:58:11 PDT 2023


jsjodin added inline comments.


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:4376
+    function_ref<Value *(unsigned int)> CustomMapperCB) {
+  auto EmitNonContiguousDescriptor = [&]() {
+    MapInfosTy::StructNonContiguousInfo &NonContigInfo =
----------------
I don't think we need a lambda function, it can be a regular method or static function?


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:4576
+      if (Info.requiresDevicePointerInfo())
+        DeviceAddrCB(I, BP, BPVal);
+
----------------
Do we need to check if DeviceAddrCB is null?


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:4601
+      Value *MFunc = ConstantPointerNull::get(Builder.getInt8PtrTy());
+      if (Value *CustomMFunc = CustomMapperCB(I))
+        MFunc = Builder.CreatePointerCast(CustomMFunc, Builder.getInt8PtrTy());
----------------
Check if CustomMapperCB is nullptr?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149872



More information about the cfe-commits mailing list