[Mlir-commits] [mlir] [mlir][spirv][vector] Support converting vector.from_elements to SPIR-V (PR #118540)

Andrea Faulds llvmlistbot at llvm.org
Tue Dec 3 12:36:35 PST 2024


================
@@ -217,6 +217,25 @@ func.func @extract_dynamic_cst(%arg0 : vector<4xf32>) -> f32 {
 
 // -----
 
+// CHECK-LABEL: @from_elements_0d
+//  CHECK-SAME: %[[ARG0:.+]]: f32
+//       CHECK:   %[[RETVAL:.+]] = builtin.unrealized_conversion_cast %[[ARG0]]
+//       CHECK:   return %[[RETVAL]]
+func.func @from_elements_0d(%arg0 : f32) -> vector<f32> {
+  %0 = vector.from_elements %arg0 : vector<f32>
+  return %0: vector<f32>
+}
+
----------------
andfau-amd wrote:

Ahh, I should probably add a case for `<1xf32>` here? `<1x1xf32>` is rejected by the type conversion at least.

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


More information about the Mlir-commits mailing list