[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
Thu Jan 1 23:08:23 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index 565c9e960..c33d5bf3f 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -2538,19 +2538,19 @@ static llvm::Value *createTaskReductionFunction(
   // Emit an empty function body in case of empty region
   if (region.empty())
     bbBuilder.CreateRet(arg0); // Return from the function
-    return function;
+  return function;
 }
 
-  SmallVector<llvm::Value *, 1> phis;
-  if (failed(inlineConvertOmpRegions(region, "", bbBuilder, moduleTranslation,
-                                     &phis)))
-    return nullptr;
-  assert(
-      phis.size() == 1 &&
-      "expected one value to be yielded from the reduction declaration region");
-  bbBuilder.CreateStore(phis[0], arg0);
-  bbBuilder.CreateRet(arg0); // Return from the function
-  return function;
+SmallVector<llvm::Value *, 1> phis;
+if (failed(inlineConvertOmpRegions(region, "", bbBuilder, moduleTranslation,
+                                   &phis)))
+  return nullptr;
+assert(
+    phis.size() == 1 &&
+    "expected one value to be yielded from the reduction declaration region");
+bbBuilder.CreateStore(phis[0], arg0);
+bbBuilder.CreateRet(arg0); // Return from the function
+return function;
 }
 
 void emitTaskRedInitCall(

``````````

</details>


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


More information about the Mlir-commits mailing list