[Mlir-commits] [mlir] [mlir][spirv][gpu] Add lowering for `gpu.subgroup_broadcast` (PR #185818)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 11 23:28:35 PDT 2026


================
@@ -135,6 +135,18 @@ LogicalResult GroupNonUniformBroadcastOp::verify() {
   return success();
 }
 
+//===----------------------------------------------------------------------===//
+// spirv.GroupNonUniformBroadcastFirstOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult GroupNonUniformBroadcastFirstOp::verify() {
+  spirv::Scope scope = getExecutionScope();
+  if (scope != spirv::Scope::Workgroup && scope != spirv::Scope::Subgroup)
+    return emitOpError("execution scope must be 'Workgroup' or 'Subgroup'");
----------------
hankluo6 wrote:

Thanks for the review. From the spec, I think SPIR-V only supports `Subgroup` here. I had noticed this earlier as well, but I was thinking it might be better to clean those up in a separate patch, since some other non-uniform ops, such as `GroupNonUniformBroadcast` and `GroupNonUniformFAdd`, also currently allow `Workgroup`, although that seems inconsistent with the spec. Would you prefer that I only fix `Broadcast` / `BroadcastFirst` in this patch?

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


More information about the Mlir-commits mailing list