[Mlir-commits] [mlir] [MLIR][XeVM] Add XeVM to LLVMIR translation. (PR #150696)
Adam Siemieniuk
llvmlistbot at llvm.org
Mon Jul 28 03:30:37 PDT 2025
================
@@ -0,0 +1,101 @@
+// RUN: mlir-translate --split-input-file -mlir-to-llvmir %s | FileCheck %s
+
+module {
+ llvm.func spir_funccc @_Z41intel_sub_group_2d_block_read_16b_8r16x1cPU3AS1viiiDv2_iPt(!llvm.ptr<1> {llvm.nonnull, llvm.readonly}, i32, i32, i32, vector<2xi32>, !llvm.ptr {llvm.nonnull, llvm.writeonly}) attributes {no_unwind, will_return}
+ llvm.func @blockload2d_cache_control(%arg0: !llvm.ptr<1>, %arg1: i32, %arg2: i32, %arg3: i32, %arg4: i32, %arg5: i32) -> vector<8xi16> {
+ %0 = llvm.mlir.undef : vector<2xi32>
+ %1 = llvm.mlir.constant(0 : i32) : i32
+ %2 = llvm.mlir.constant(1 : i32) : i32
+ %3 = llvm.insertelement %arg4, %0[%1 : i32] : vector<2xi32>
+ %4 = llvm.insertelement %arg5, %3[%2 : i32] : vector<2xi32>
+ %5 = llvm.mlir.constant(8 : i32) : i32
+ %6 = llvm.alloca %5 x i16 : (i32) -> !llvm.ptr
+ // CHECK-LABEL: call spir_func void @_Z41intel_sub_group_2d_block_read_16b_8r16x1cPU3AS1viiiDv2_iPt
+ // CHECK-SAME: !spirv.DecorationCacheControlINTEL ![[DECO1:.*]]
+ llvm.call spir_funccc @_Z41intel_sub_group_2d_block_read_16b_8r16x1cPU3AS1viiiDv2_iPt(%arg0, %arg1, %arg2, %arg3, %4, %6)
+ {function_type = !llvm.func<void (ptr<1>, i32, i32, i32, vector<2xi32>, ptr)>, linkage = #llvm.linkage<external>, no_unwind,
+ sym_name = "_Z41intel_sub_group_2d_block_read_16b_8r16x1cPU3AS1viiiDv2_iPt", visibility_ = 0 : i64, will_return,
+ xevm.DecorationCacheControl = [[6442 : i32, 0 : i32, 1 : i32, 0 : i32], [6442 : i32, 1 : i32, 1 : i32, 0 : i32]]}
+ : (!llvm.ptr<1> {llvm.nonnull, llvm.readonly}, i32, i32, i32, vector<2xi32>, !llvm.ptr {llvm.nonnull, llvm.writeonly}) -> ()
----------------
adam-smnk wrote:
I wonder if all these details are required to only validate `xevm.DecorationCacheControl` conversion.
Maybe the example could be reduced to sth simpler?
https://github.com/llvm/llvm-project/pull/150696
More information about the Mlir-commits
mailing list