[Mlir-commits] [mlir] [MLIR][GPUToLLVMSPV] Use `llvm.func` attributes to convert `gpu.shuffle` (PR #116967)
Victor Perez
llvmlistbot at llvm.org
Wed Nov 20 07:51:55 PST 2024
================
@@ -383,7 +308,20 @@ gpu.module @shuffles attributes {
%shuffleResult4, %valid4 = gpu.shuffle up %f16_val, %offset, %width : f16
%shuffleResult5, %valid5 = gpu.shuffle up %f32_val, %offset, %width : f32
%shuffleResult6, %valid6 = gpu.shuffle down %f64_val, %offset, %width : f64
- return
+ llvm.return
+ }
+}
+
+// -----
+
+// Check attaching a discardable attribute to a `gpu.func` hosting a `gpu.shuffle` operation works,
+// i.e., the attribute is propagated.
+
+gpu.module @shuffles_ {
+ gpu.func @propagated_size(%val: i32, %id: i32) attributes {intel_reqd_sub_group_size = 16 : i32} {
----------------
victor-eds wrote:
This isn't a discardable attribute from the `llvm` dialect, but an attribute that will be propagated in the conversion to `llvm.func` and understood as the `llvm.func` op attribute.
This is a use-case I am not interested in, but an example of how you could have a parent function, convert that to LLVM and then convert the `gpu.shuffle` operation. Do you think it'd be better to drop this case?
https://github.com/llvm/llvm-project/pull/116967
More information about the Mlir-commits
mailing list