[Mlir-commits] [mlir] [OpenMP][OpenMPIRBuilder][NFC] Move copyInput to a passed in lambda function (PR #68124)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Oct 3 10:24:33 PDT 2023


================
@@ -2166,6 +2166,9 @@ class OpenMPIRBuilder {
   using TargetBodyGenCallbackTy = function_ref<InsertPointTy(
       InsertPointTy AllocaIP, InsertPointTy CodeGenIP)>;
 
+  using TargetGenArgAccessorsCallbackTy = function_ref<Value *(
+      Argument &Arg, Value *Input, IRBuilderBase &Builder)>;
----------------
agozillon wrote:

Yes, it appears to be necessary, the OpenMPIRBuilder has it's own LLVM builder that it utilises internally which will end up with a different InsertionPoint as the lowering of createTarget progresses, All we currently do is pass an initial insertion point to createTarget and then the internal OpenMPIRBuilder's LLVM builder takes this insertion point and progresses it and then returns the end insertion point back up to the original ModuleTranslation's LLVM builder so it can continue working from wherever the OpenMPIRBuilder left off! That's how I understand it at least. So using the local copy by reference will result in inserting the new instructions at the incorrect location as it won't ever actually be used by the OpenMPIRBuilder. 

https://github.com/llvm/llvm-project/pull/68124


More information about the Mlir-commits mailing list