[Mlir-commits] [mlir] [mlir] GPUToROCDL: repack usupported types when lowering `subgroup_broadcast` (PR #174206)

Jakub Kuderski llvmlistbot at llvm.org
Fri Jan 2 06:05:06 PST 2026


================
@@ -171,11 +171,26 @@ struct GPUSubgroupSizeOpToROCDL : ConvertOpToLLVMPattern<gpu::SubgroupSizeOp> {
 };
 
 static bool isSupportedReadLaneType(Type type) {
-  // read(first)lane also supports some vector types, but limit it for scalars
-  // for now.
-  return type.isInteger(16) || type.isInteger(32) || type.isInteger(64) ||
-         isa<Float16Type, BFloat16Type, Float32Type, Float64Type,
-             LLVM::LLVMPointerType>(type);
+  // https://llvm.org/docs/AMDGPUUsage.html#llvm-ir-intrinsics
+  if (isa<Float16Type, BFloat16Type, Float32Type, Float64Type,
+          LLVM::LLVMPointerType>(type))
+    return true;
+
+  if (auto intType = dyn_cast<IntegerType>(type))
+    return llvm::is_contained({16, 32, 64}, (int)intType.getWidth());
----------------
kuhar wrote:

nit: use static_cast per https://llvm.org/docs/CodingStandards.html#prefer-c-style-casts

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


More information about the Mlir-commits mailing list