[llvm-branch-commits] [clang] [CIR][NVPTX] Implement sync and cluster barrier builtins (PR #195217)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 30 22:00:41 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 -- clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.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/clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp
index 2babb7d04..0eb55787f 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp
@@ -921,19 +921,17 @@ CIRGenFunction::emitNVPTXBuiltinExpr(unsigned builtinId, const CallExpr *expr) {
   case NVPTX::BI__nvvm_bar_sync:
     return builder.emitIntrinsicCallOp(
         getLoc(expr->getExprLoc()), "nvvm.barrier.cta.sync.aligned.all",
-        builder.getVoidTy(),
-        mlir::ValueRange{emitScalarExpr(expr->getArg(0))});
+        builder.getVoidTy(), mlir::ValueRange{emitScalarExpr(expr->getArg(0))});
   case NVPTX::BI__syncthreads:
     return builder.emitIntrinsicCallOp(
         getLoc(expr->getExprLoc()), "nvvm.barrier.cta.sync.aligned.all",
         builder.getVoidTy(),
-        mlir::ValueRange{builder.getConstInt(
-            getLoc(expr->getExprLoc()), builder.getSInt32Ty(), 0)});
+        mlir::ValueRange{builder.getConstInt(getLoc(expr->getExprLoc()),
+                                             builder.getSInt32Ty(), 0)});
   case NVPTX::BI__nvvm_barrier_sync:
     return builder.emitIntrinsicCallOp(
         getLoc(expr->getExprLoc()), "nvvm.barrier.cta.sync.all",
-        builder.getVoidTy(),
-        mlir::ValueRange{emitScalarExpr(expr->getArg(0))});
+        builder.getVoidTy(), mlir::ValueRange{emitScalarExpr(expr->getArg(0))});
   case NVPTX::BI__nvvm_barrier_sync_cnt:
     return builder.emitIntrinsicCallOp(
         getLoc(expr->getExprLoc()), "nvvm.barrier.cta.sync.count",

``````````

</details>


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


More information about the llvm-branch-commits mailing list