[llvm] [mlir] [OpenMP] [IR Builder] Changes to Support Scan Operation (PR #136035)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 18 13:40:56 PDT 2025


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 HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
``````````

</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 b6a5f6d0f..5b547e0ba 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -1226,8 +1226,8 @@ static void collectReductionInfo(
     llvm::Type *reductionType =
         moduleTranslation.convertType(reductionDecls[i].getType());
     ReductionVarToType[privateReductionVariables[i]] = reductionType;
-      reductionInfos.push_back(
-        {reductionType, variable, privateReductionVariables[i],         
+    reductionInfos.push_back(
+        {reductionType, variable, privateReductionVariables[i],
          /*EvaluationKind=*/llvm::OpenMPIRBuilder::EvalKind::Scalar,
          owningReductionGens[i],
          /*ReductionGenClang=*/nullptr, atomicGen});
@@ -2737,7 +2737,7 @@ convertOmpSimd(Operation &opInst, llvm::IRBuilderBase &builder,
     return failure();
 
   builder.SetInsertPoint(*regionBlock, (*regionBlock)->begin());
-    SmallVector<llvm::CanonicalLoopInfo *> loopInfos =
+  SmallVector<llvm::CanonicalLoopInfo *> loopInfos =
       findCurrentLoopInfos(moduleTranslation);
   for (llvm::CanonicalLoopInfo *loopInfo : loopInfos) {
     ompBuilder->applySimd(
@@ -2816,7 +2816,7 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
           wsloopOp.getReductionMod() && (wsloopOp.getReductionMod().value() ==
                                          mlir::omp::ReductionModifier::inscan);
       if (isInScanRegion) {
-        //TODO: Handle nesting if Scan loop is nested in a loop
+        // TODO: Handle nesting if Scan loop is nested in a loop
         assert(loopOp.getNumLoops() == 1);
         llvm::Expected<SmallVector<llvm::CanonicalLoopInfo *>> loopResults =
             ompBuilder->createCanonicalScanLoops(

``````````

</details>


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


More information about the llvm-commits mailing list