Changes to accommodate latest IREE API

Necessary changes to accommodate latest IREE.

Also temporarily disable VMVX inlineHAL until upstream issue is fixed.

Change-Id: If4f521e3dac137f5dcee499540e160741370b669
diff --git a/cmake/springbok_modules.cmake b/cmake/springbok_modules.cmake
index ba3c6bc..206374c 100644
--- a/cmake/springbok_modules.cmake
+++ b/cmake/springbok_modules.cmake
@@ -79,6 +79,8 @@
     EMITC
   )
 
+  # TODO(lundong): Re-enable InlineHAL VMVX after
+  # github.com/openxla/iree/issues/12620 is resolved
   if (${_RULE_VMVX})
     springbok_vmvx_module(
       NAME
@@ -89,7 +91,6 @@
         "${_RULE_C_IDENTIFIER}_bytecode_module_vmvx"
       FLAGS
         "${_RULE_FLAGS}"
-      "${_INLINE_HAL_ARG}"
     )
 
     springbok_vmvx_module(
@@ -99,7 +100,6 @@
         "${_RULE_SRC}"
       FLAGS
         "${_RULE_FLAGS}"
-      "${_INLINE_HAL_ARG}"
       EMITC
     )
   endif()
diff --git a/cmake/springbok_static_module.cmake b/cmake/springbok_static_module.cmake
index 099a615..7fef4cb 100644
--- a/cmake/springbok_static_module.cmake
+++ b/cmake/springbok_static_module.cmake
@@ -71,7 +71,7 @@
   iree_package_name(_PACKAGE_NAME)
   iree_package_ns(_PACKAGE_NS)
 
-  set(_CPU_FEATURES "+m,+f,+zvl512b,+zve32x")
+  set(_CPU_FEATURES "+m,+f,+zvl512b,+zve32f")
   if (${_RULE_RVV_OFF})
     set(_CPU_FEATURES "+m,+f")
   endif()
@@ -79,14 +79,14 @@
   # Set common iree-compile flags
   set(_COMPILER_ARGS ${_RULE_FLAGS})
   list(APPEND _COMPILER_ARGS "--iree-hal-target-backends=llvm-cpu")
-  list(APPEND _COMPILER_ARGS "--iree-llvm-debug-symbols=false")
+  list(APPEND _COMPILER_ARGS "--iree-llvmcpu-debug-symbols=false")
   list(APPEND _COMPILER_ARGS "--iree-vm-bytecode-module-strip-source-map=true")
   list(APPEND _COMPILER_ARGS "--iree-vm-emit-polyglot-zip=false")
-  list(APPEND _COMPILER_ARGS "--iree-llvm-target-triple=riscv32-pc-linux-elf")
-  list(APPEND _COMPILER_ARGS "--iree-llvm-target-cpu=generic-rv32")
-  list(APPEND _COMPILER_ARGS "--iree-llvm-target-cpu-features=${_CPU_FEATURES}")
-  list(APPEND _COMPILER_ARGS "--iree-llvm-target-abi=ilp32")
-  list(APPEND _COMPILER_ARGS "--iree-llvm-link-embedded=false")
+  list(APPEND _COMPILER_ARGS "--iree-llvmcpu-target-triple=riscv32-pc-linux-elf")
+  list(APPEND _COMPILER_ARGS "--iree-llvmcpu-target-cpu=generic-rv32")
+  list(APPEND _COMPILER_ARGS "--iree-llvmcpu-target-cpu-features=${_CPU_FEATURES}")
+  list(APPEND _COMPILER_ARGS "--iree-llvmcpu-target-abi=ilp32")
+  list(APPEND _COMPILER_ARGS "--iree-llvmcpu-link-embedded=false")
   if (${_RULE_INLINE_HAL})
     list(APPEND _COMPILER_ARGS "--iree-execution-model=inline-dynamic")
   endif()
@@ -99,8 +99,8 @@
     get_filename_component(_MLIR_SRC "${_MLIR_SRC}" REALPATH)
     list(APPEND _COMPILER_ARGS "--output-format=vm-c")
     list(APPEND _COMPILER_ARGS "--iree-vm-target-index-bits=32")
-    list(APPEND _COMPILER_ARGS "--iree-llvm-link-static")
-    list(APPEND _COMPILER_ARGS "--iree-llvm-static-library-output-path=${_O_FILE_NAME}")
+    list(APPEND _COMPILER_ARGS "--iree-llvmcpu-link-static")
+    list(APPEND _COMPILER_ARGS "--iree-llvmcpu-static-library-output-path=${_O_FILE_NAME}")
     list(APPEND _COMPILER_ARGS "${_MLIR_SRC}")
     list(APPEND _COMPILER_ARGS "-o")
     list(APPEND _COMPILER_ARGS "${_H_FILE_NAME}")
diff --git a/model_util/model_api.h b/model_util/model_api.h
index abddf81..89a297c 100644
--- a/model_util/model_api.h
+++ b/model_util/model_api.h
@@ -21,7 +21,7 @@
 
 #include "iree/hal/local/executable_library.h"
 #include "iree/modules/hal/module.h"
-#include "iree/vm/bytecode_module.h"
+#include "iree/vm/bytecode/module.h"
 
 #define MAX_MODEL_INPUT_NUM 2
 #define MAX_MODEL_INPUT_DIM 4
diff --git a/model_util/util.c b/model_util/util.c
index 768fc92..11cba21 100644
--- a/model_util/util.c
+++ b/model_util/util.c
@@ -208,7 +208,7 @@
     if (iree_status_is_ok(result)) {
       // Get the result buffers from the invocation.
       ret_buffer_view = (iree_hal_buffer_view_t *)iree_vm_list_get_ref_deref(
-          outputs, index_output, iree_hal_buffer_view_get_descriptor());
+          outputs, index_output, &iree_hal_buffer_view_descriptor);
       if (ret_buffer_view == NULL) {
         result = iree_make_status(IREE_STATUS_NOT_FOUND,
                                   "can't find return buffer view");
diff --git a/samples/simple_vec_mul/CMakeLists.txt b/samples/simple_vec_mul/CMakeLists.txt
index da7b17d..31a0060 100644
--- a/samples/simple_vec_mul/CMakeLists.txt
+++ b/samples/simple_vec_mul/CMakeLists.txt
@@ -4,6 +4,8 @@
 # https://github.com/llvm/llvm-project/blob/0eeab8b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp#L30-L51
 #-------------------------------------------------------------------------------
 
+# TODO(lundong): Re-enable InlineHAL VMVX after
+# github.com/openxla/iree/issues/12620 is resolved
 springbok_modules(
   NAME
     simple_float_mul
@@ -49,6 +51,8 @@
 #
 # to increase it.
 
+# TODO(lundong): Re-enable InlineHAL VMVX after
+# github.com/openxla/iree/issues/12620 is resolved
 iree_cc_binary(
   NAME
     simple_float_vec_mul_bytecode_vmvx
@@ -56,7 +60,7 @@
     "float_vec.c"
   DEPS
     ::simple_float_mul_bytecode_module_vmvx_c
-    model_util::util_vmvx_inline
+    model_util::util_vmvx
   LINKOPTS
     "LINKER:--defsym=__stack_size__=20k"
   COPTS
@@ -70,7 +74,7 @@
     "float_vec.c"
   DEPS
     ::simple_float_mul_c_module_vmvx_emitc
-    model_util::util_vmvx_inline
+    model_util::util_vmvx
   LINKOPTS
     "LINKER:--defsym=__stack_size__=20k"
   COPTS
@@ -86,7 +90,7 @@
   DEPS
     ::simple_float_mul_bytecode_module_static_c
     ::simple_float_mul_bytecode_module_static_lib
-    iree::vm::bytecode_module
+    iree::vm::bytecode::module
     model_util::util_static_inline
   LINKOPTS
     "LINKER:--defsym=__stack_size__=20k"
@@ -107,6 +111,8 @@
     "-DBUILD_EMITC"
 )
 
+# TODO(lundong): Re-enable InlineHAL VMVX after
+# github.com/openxla/iree/issues/12620 is resolved
 iree_cc_binary(
   NAME
     simple_int_vec_mul_bytecode_vmvx
@@ -114,7 +120,7 @@
     "int_vec.c"
   DEPS
     ::simple_int_mul_bytecode_module_vmvx_c
-    model_util::util_vmvx_inline
+    model_util::util_vmvx
   LINKOPTS
     "LINKER:--defsym=__stack_size__=20k"
   COPTS
@@ -128,7 +134,7 @@
     "int_vec.c"
   DEPS
     ::simple_int_mul_c_module_vmvx_emitc
-    model_util::util_vmvx_inline
+    model_util::util_vmvx
   LINKOPTS
     "LINKER:--defsym=__stack_size__=20k"
   COPTS
@@ -144,7 +150,7 @@
   DEPS
     ::simple_int_mul_bytecode_module_static_c
     ::simple_int_mul_bytecode_module_static_lib
-    iree::vm::bytecode_module
+    iree::vm::bytecode::module
     model_util::util_static_inline
   LINKOPTS
     "LINKER:--defsym=__stack_size__=20k"
diff --git a/vmvx_ukernel/CMakeLists.txt b/vmvx_ukernel/CMakeLists.txt
index 89f13a8..67e0e6c 100644
--- a/vmvx_ukernel/CMakeLists.txt
+++ b/vmvx_ukernel/CMakeLists.txt
@@ -49,7 +49,7 @@
   DEPS
     ::vmvx
     iree::hal::local::executable_loader
-    iree::vm::bytecode_module
+    iree::vm::bytecode::module
   DEFINES
     "IREE_HAVE_HAL_EXECUTABLE_LOADER_VMVX_MODULE=1"
   PUBLIC
diff --git a/vmvx_ukernel/query_tile_sizes.c b/vmvx_ukernel/query_tile_sizes.c
index 8a777aa..4bab96e 100644
--- a/vmvx_ukernel/query_tile_sizes.c
+++ b/vmvx_ukernel/query_tile_sizes.c
@@ -30,8 +30,6 @@
   iree_uk_uint32_t role = iree_uk_query_tile_sizes_operand_role(params->flags);
   IREE_UK_ASSERT(role == IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_LHS ||
                  role == IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RHS ||
-                 role ==
-                     IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RHS_TRANSPOSE ||
                  role == IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RESULT);
   const iree_uk_int64_t kDynamic = IREE_UK_INT64_MIN;
   IREE_UK_ASSERT((params->size0 >= 0 || params->size0 == kDynamic) ||
@@ -70,9 +68,6 @@
     out_params->tile_size0 = matmul_tile_sizes.M;
     out_params->tile_size1 = matmul_tile_sizes.K;
   } else if (role == IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RHS) {
-    out_params->tile_size0 = matmul_tile_sizes.K;
-    out_params->tile_size1 = matmul_tile_sizes.N;
-  } else if (role == IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RHS_TRANSPOSE) {
     out_params->tile_size0 = matmul_tile_sizes.N;
     out_params->tile_size1 = matmul_tile_sizes.K;
   } else if (role == IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RESULT) {