[flang-commits] [flang] [llvm] [mlir] [flang][mlir][OpenMP] Support iterator modifier in declare mapper map clause (PR #235491)

via flang-commits flang-commits at lists.llvm.org
Sun Oct 25 10:10:01 PDT 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 h,cpp -- flang/include/flang/Utils/OpenMP.h flang/lib/Lower/OpenMP/ClauseProcessor.cpp flang/lib/Lower/OpenMP/ClauseProcessor.h flang/lib/Lower/OpenMP/Clauses.cpp flang/lib/Lower/OpenMP/OpenMP.cpp flang/lib/Lower/OpenMP/Utils.cpp flang/lib/Lower/OpenMP/Utils.h flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp flang/lib/Semantics/check-omp-structure.cpp flang/lib/Utils/OpenMP.cpp llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h llvm/lib/Frontend/OpenMP/OMPIRBuilder.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 01fd47b07..966ff2f71 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -617,10 +617,10 @@ static LogicalResult checkImplementationStatus(Operation &op) {
         if (supported) {
           auto mapInfoOp =
               yieldOp.getResults()[0].getDefiningOp<omp::MapInfoOp>();
-          supported = mapInfoOp && !mapInfoOp.getVarPtrPtr() &&
-                      mapInfoOp.getMembers().empty() &&
-                      mapInfoOp.getMapCaptureType() ==
-                          omp::VariableCaptureKind::ByRef;
+          supported =
+              mapInfoOp && !mapInfoOp.getVarPtrPtr() &&
+              mapInfoOp.getMembers().empty() &&
+              mapInfoOp.getMapCaptureType() == omp::VariableCaptureKind::ByRef;
         }
       }
       if (!supported) {
@@ -8764,16 +8764,17 @@ emitUserDefinedMapper(Operation *op, llvm::IRBuilderBase &builder,
       // value map.
       seg.GenEntry = [&moduleTranslation, itersOp, mapInfoOp, baseLLVMTy,
                       sizeVal, iterInfo](llvm::IRBuilderBase &b,
-                                        llvm::Value *linearIV) mutable
+                                         llvm::Value *linearIV) mutable
           -> llvm::Expected<llvm::SmallVector<llvm::Value *, 3>> {
-        if (failed(convertIteratorRegion(linearIV, iterInfo, itersOp.getRegion(),
-                                         b, moduleTranslation)))
+        if (failed(convertIteratorRegion(
+                linearIV, iterInfo, itersOp.getRegion(), b, moduleTranslation)))
           return llvm::make_error<PreviouslyReportedError>();
-        llvm::Value *base = moduleTranslation.lookupValue(mapInfoOp.getVarPtr());
+        llvm::Value *base =
+            moduleTranslation.lookupValue(mapInfoOp.getVarPtr());
         bool isByteOffset = false;
-        std::vector<llvm::Value *> offsetIdx = calculateBoundsOffset(
-            moduleTranslation, b, baseLLVMTy->isArrayTy(), mapInfoOp.getBounds(),
-            isByteOffset);
+        std::vector<llvm::Value *> offsetIdx =
+            calculateBoundsOffset(moduleTranslation, b, baseLLVMTy->isArrayTy(),
+                                  mapInfoOp.getBounds(), isByteOffset);
         llvm::Value *addr = base;
         if (!offsetIdx.empty())
           addr = b.CreateInBoundsGEP(isByteOffset ? b.getInt8Ty() : baseLLVMTy,

``````````

</details>


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


More information about the flang-commits mailing list