[Mlir-commits] [mlir] [mlir] Translating task_reduction clause for pass-by-value vars to LLVMIR (PR #125218)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 2 05:08:42 PST 2026


================
@@ -2469,6 +2473,228 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase &builder,
   return success();
 }
 
+template <typename OP>
+static llvm::Value *createTaskReductionFunction(
+    llvm::IRBuilderBase &builder, const std::string &name, llvm::Type *redTy,
+    LLVM::ModuleTranslation &moduleTranslation,
+    SmallVectorImpl<omp::DeclareReductionOp> &reductionDecls, Region &region,
+    OP &op, unsigned cnt,
+    SmallVectorImpl<llvm::Value *> &privateReductionVariables,
+    DenseMap<Value, llvm::Value *> &reductionVariableMap) {
+
+  llvm::LLVMContext &Context = builder.getContext();
+  // TODO: by-ref reduction variables are yet to be handled.
+  llvm::Type *OpaquePtrTy = llvm::PointerType::get(Context, 0);
----------------
NimishMishra wrote:

I see. Thanks for the pointer. I have used `llvm::PointerType::get(Context, DL.getProgramAddressSpace());` now, would that be fine? 

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


More information about the Mlir-commits mailing list