jhuber6 added inline comments.

================
Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:1161
 
-    LinkedImages.push_back(*ImageOrErr);
+    LinkedImages.emplace_back(TheArch, *ImageOrErr);
   }
----------------
I'm doing something similar in D123810, I just used the existing `DeviceFile` 
because I needed the `Arch` and `Kind` fields to dispatch the appropriate 
wrapping job for CUDA / HIP.


================
Comment at: clang/tools/clang-linker-wrapper/OffloadWrapper.cpp:246
   IRBuilder<> Builder(BasicBlock::Create(C, "entry", Func));
+  // Create calls to __tgt_register_image_info for each image
+  auto *NullPtr = llvm::ConstantPointerNull::get(Builder.getInt8PtrTy());
----------------
I'm wondering if it would be better to create a new `__tgt_bin_desc` and call a 
new `__tgt_register_lib` with it here so we don't need multiple calls here. 
Inside that new runtime function we could just widen or shrink the existing 
structs as needed. That way each device image would have this metadata 
associated with it and the target plugin can handle it as-needed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124525

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to