[flang-commits] [flang] [mlir] [MLIR][NVVM] Split nvvm.barrier into nvvm.barrier and nvvm.barrier.reduction (PR #199404)
via flang-commits
flang-commits at lists.llvm.org
Sun May 24 01:27:57 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 cpp -- flang/lib/Optimizer/Builder/CUDAIntrinsicCall.cpp mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.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/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
index e03b37a1c..ef4207a50 100644
--- a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
+++ b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
@@ -415,8 +415,8 @@ struct AssertOpToAssertfailLowering
/// Follows the SSA chain `insertvalue[0] -> load -> addressof -> global`
/// to recover the integer initializer behind field [0] of `namedBarrier`,
/// since `nvvm.barrier` carries `barrierId` as an `IntegerAttr`.
-static FailureOr<uint32_t>
-extractStaticNamedBarrierId(Operation *contextOp, Value namedBarrier) {
+static FailureOr<uint32_t> extractStaticNamedBarrierId(Operation *contextOp,
+ Value namedBarrier) {
auto insertOp = namedBarrier.getDefiningOp<LLVM::InsertValueOp>();
while (insertOp && insertOp.getPosition() != ArrayRef<int64_t>{0})
insertOp = insertOp.getContainer().getDefiningOp<LLVM::InsertValueOp>();
diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
index 29f969874..2cd1c0ea9 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
@@ -2936,9 +2936,7 @@ static LogicalResult verifyBarrierIdRange(BarrierLikeOp op) {
return success();
}
-LogicalResult NVVM::BarrierOp::verify() {
- return verifyBarrierIdRange(*this);
-}
+LogicalResult NVVM::BarrierOp::verify() { return verifyBarrierIdRange(*this); }
LogicalResult NVVM::BarrierReductionOp::verify() {
return verifyBarrierIdRange(*this);
``````````
</details>
https://github.com/llvm/llvm-project/pull/199404
More information about the flang-commits
mailing list