Integrate MLIR-EmitC at iml130/mlir-emitc@d9b2dde (#3800)

Switches over from the iree specific branch to the main branch.
diff --git a/SUBMODULE_VERSIONS b/SUBMODULE_VERSIONS
index 0910aa6..0f91690 100644
--- a/SUBMODULE_VERSIONS
+++ b/SUBMODULE_VERSIONS
@@ -7,7 +7,7 @@
 f2fb48c3b3d79a75a88a99fba6576b25d42ec528 third_party/googletest
 e3f662922d8340a7fd46a4f75cad0e72163bf219 third_party/llvm-bazel
 f147f59cd377a6be68e5ca5c343eb11df8e7ee6f third_party/llvm-project
-9e970e18057e80e8af07f96d73714e395bac98d1 third_party/mlir-emitc
+d9b2dde1ba2e75cbfcb2bb933bc9deb595fa7bdc third_party/mlir-emitc
 74d7261be17cf659d5930d4830609406bd7553e3 third_party/pffft
 d8c7ee00a687ac369e62e2032514a93a9b413502 third_party/pybind11
 d79362c24fd70eab3196672273dbfd8f0dd6124c third_party/ruy
diff --git a/build_tools/cmake/iree_copts.cmake b/build_tools/cmake/iree_copts.cmake
index b569da9..967a7f1 100644
--- a/build_tools/cmake/iree_copts.cmake
+++ b/build_tools/cmake/iree_copts.cmake
@@ -300,6 +300,9 @@
 #-------------------------------------------------------------------------------
 
 if(IREE_ENABLE_EMITC)
+  set(EMITC_ENABLE_HLO OFF)
+  set(EMITC_INCLUDE_TESTS OFF)
+
   list(APPEND IREE_COMMON_INCLUDE_DIRS
     ${PROJECT_SOURCE_DIR}/third_party/mlir-emitc/include
     ${PROJECT_BINARY_DIR}/third_party/mlir-emitc/include
diff --git a/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp b/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp
index e2b9c8f..46e9469 100644
--- a/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp
+++ b/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp
@@ -46,10 +46,12 @@
     ArrayAttr args =
         rewriter.getArrayAttr({IntegerAttr::get(rewriter.getIndexType(), 0),
                                IntegerAttr::get(rewriter.getIndexType(), 1)});
+    ArrayAttr templateArgs;
     ValueRange dstOperands{srcAdapter.lhs(), srcAdapter.rhs()};
 
     rewriter.replaceOpWithNewOp<DstOpTy>(srcOp, srcAdapter.lhs().getType(),
-                                         callee, args, dstOperands);
+                                         callee, args, templateArgs,
+                                         dstOperands);
 
     return success();
   }
diff --git a/third_party/mlir-emitc b/third_party/mlir-emitc
index 9e970e1..d9b2dde 160000
--- a/third_party/mlir-emitc
+++ b/third_party/mlir-emitc
@@ -1 +1 @@
-Subproject commit 9e970e18057e80e8af07f96d73714e395bac98d1
+Subproject commit d9b2dde1ba2e75cbfcb2bb933bc9deb595fa7bdc