Merge branch 'google' into main-to-google
diff --git a/SUBMODULE_VERSIONS b/SUBMODULE_VERSIONS
index fc186cc..ac768f1 100644
--- a/SUBMODULE_VERSIONS
+++ b/SUBMODULE_VERSIONS
@@ -6,7 +6,7 @@
 4fb0ff7069bd88ee85902f4d0bb62794e5f6d021 third_party/flatcc
 f2fb48c3b3d79a75a88a99fba6576b25d42ec528 third_party/googletest
 2ad01e4b485d8753600766d967d1a7358b98ddd3 third_party/llvm-bazel
-c8d73d939fa4fda9c87b3979225d02d63062bd68 third_party/llvm-project
+c30ab6c2a307cfdce8323ed94c3d70eb2d26bc14 third_party/llvm-project
 55801f03f9cc69abfcf8b508a873f702c11b3b5f third_party/mlir-emitc
 74d7261be17cf659d5930d4830609406bd7553e3 third_party/pffft
 d8c7ee00a687ac369e62e2032514a93a9b413502 third_party/pybind11
diff --git a/integrations/tensorflow/compiler/dialect/tf_tensorlist/conversion/test/convert_tf_to_tf_tensorlist.mlir b/integrations/tensorflow/compiler/dialect/tf_tensorlist/conversion/test/convert_tf_to_tf_tensorlist.mlir
index 38f1aeb..1f08ff4 100644
--- a/integrations/tensorflow/compiler/dialect/tf_tensorlist/conversion/test/convert_tf_to_tf_tensorlist.mlir
+++ b/integrations/tensorflow/compiler/dialect/tf_tensorlist/conversion/test/convert_tf_to_tf_tensorlist.mlir
@@ -1,4 +1,4 @@
-// RUN: iree-tf-opt %s -pass-pipeline=convert-tf-to-tf_tensorlist -split-input-file -allow-unregistered-dialect -verify-diagnostics | IreeFileCheck %s
+// RUN: iree-tf-opt %s -pass-pipeline='func(convert-tf-to-tf_tensorlist)' -split-input-file -allow-unregistered-dialect -verify-diagnostics | IreeFileCheck %s
 
 // TODO(silvasean): Handle interprocedural conversion.
 
diff --git a/iree/compiler/Conversion/CodegenUtils/GetNumWorkgroups.h b/iree/compiler/Conversion/CodegenUtils/GetNumWorkgroups.h
index 0ce710f..e8cd9db 100644
--- a/iree/compiler/Conversion/CodegenUtils/GetNumWorkgroups.h
+++ b/iree/compiler/Conversion/CodegenUtils/GetNumWorkgroups.h
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef MLIR_EDGE_BENCHMARKS_STRATEGIES_WORKGROUPCALULCATION_H_
-#define MLIR_EDGE_BENCHMARKS_STRATEGIES_WORKGROUPCALULCATION_H_
+#ifndef IREE_COMPILER_CONVERSION_CODEGENUTILS_GETNUMWORKGROUPS_H_
+#define IREE_COMPILER_CONVERSION_CODEGENUTILS_GETNUMWORKGROUPS_H_
 
 #include <cstdint>
 
@@ -94,4 +94,4 @@
 }  // namespace iree_compiler
 }  // namespace mlir
 
-#endif  // MLIR_EDGE_BENCHMARKS_STRATEGIES_WORKGROUPCALULCATION_H_
+#endif  // IREE_COMPILER_CONVERSION_CODEGENUTILS_GETNUMWORKGROUPS_H_
diff --git a/iree/compiler/Conversion/CodegenUtils/MatmulCodegenStrategy.cpp b/iree/compiler/Conversion/CodegenUtils/MatmulCodegenStrategy.cpp
index 654e421..43bbf3e 100644
--- a/iree/compiler/Conversion/CodegenUtils/MatmulCodegenStrategy.cpp
+++ b/iree/compiler/Conversion/CodegenUtils/MatmulCodegenStrategy.cpp
@@ -13,10 +13,8 @@
 // limitations under the License.
 
 // -----------------------------------------------------------------------------
-// This is a copy of the matmul strategy infrastructure existing in mlir_edge.
-// This version will be removed once this gets upstreamed to common mlir.
-// Please try to limit changes in this code only minor changes or make sure the
-// changes are applied in mlir_edge as well.
+// This code will be removed once this gets upstreamed to common mlir.
+// Please try to limit changes in this code only minor changes.
 
 #include "iree/compiler/Conversion/CodegenUtils/MatmulCodegenStrategy.h"
 
diff --git a/iree/compiler/Conversion/LinalgToSPIRV/KernelDispatchUtils.cpp b/iree/compiler/Conversion/LinalgToSPIRV/KernelDispatchUtils.cpp
index a233a8b..16d4510 100644
--- a/iree/compiler/Conversion/LinalgToSPIRV/KernelDispatchUtils.cpp
+++ b/iree/compiler/Conversion/LinalgToSPIRV/KernelDispatchUtils.cpp
@@ -407,14 +407,12 @@
   //   producer and consumer must match for the parallel loops.
   for (auto dependence :
        dependenceGraph.getDependentOperations(rootOperation.getValue())) {
-    Optional<unsigned> viewIndex =
-        rootOperation->getIndexOfShapedOperand(dependence.indexingView);
-    AffineMap indexingMap = rootOperation->getIndexingMap(*viewIndex);
+    unsigned viewIndex = dependence.indexingOpView.operandIndex;
+    AffineMap indexingMap = rootOperation->getIndexingMap(viewIndex);
     linalg::LinalgOp fusedOp =
         cast<linalg::LinalgOp>(dependence.dependentOpView.op);
-    Optional<unsigned> fusedViewIndex =
-        fusedOp.getIndexOfShapedOperand(dependence.dependentOpView.view);
-    AffineMap fusedIndexingMap = fusedOp.getIndexingMap(*fusedViewIndex);
+    unsigned fusedViewIndex = dependence.dependentOpView.operandIndex;
+    AffineMap fusedIndexingMap = fusedOp.getIndexingMap(fusedViewIndex);
     if (indexingMap.getNumResults() < numOuterParallel ||
         fusedIndexingMap.getNumResults() < numOuterParallel ||
         !llvm::all_of(
diff --git a/iree/compiler/Conversion/LinalgToSPIRV/VectorizeMemref.cpp b/iree/compiler/Conversion/LinalgToSPIRV/VectorizeMemref.cpp
index 9391676..53846d8 100644
--- a/iree/compiler/Conversion/LinalgToSPIRV/VectorizeMemref.cpp
+++ b/iree/compiler/Conversion/LinalgToSPIRV/VectorizeMemref.cpp
@@ -265,8 +265,8 @@
       ConversionPatternRewriter &rewriter) const override {
     auto memrefType = getVectorizedMemRefType(rewriter, alloc.getType());
     if (!memrefType) return failure();
-    Value newAlloc =
-        rewriter.create<AllocOp>(alloc.getLoc(), *memrefType, alloc.value());
+    Value newAlloc = rewriter.create<AllocOp>(alloc.getLoc(), *memrefType,
+                                              alloc.dynamicSizes());
     rewriter.replaceOp(alloc, newAlloc);
     return success();
   }
diff --git a/iree/compiler/Conversion/LinalgToVector/LoadStoreVectorization.cpp b/iree/compiler/Conversion/LinalgToVector/LoadStoreVectorization.cpp
index e5358c5..e4c236c 100644
--- a/iree/compiler/Conversion/LinalgToVector/LoadStoreVectorization.cpp
+++ b/iree/compiler/Conversion/LinalgToVector/LoadStoreVectorization.cpp
@@ -206,6 +206,7 @@
         genericOp.iterator_types(),
         /*doc=*/nullptr,
         /*library_call=*/nullptr,
+        genericOp.sparseAttr(),
         /*symbol_source=*/nullptr);
 
     Region &newRegion = newOp.region();
diff --git a/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/constant_ops.mlir b/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/constant_ops.mlir
index 17dae9c..4692292 100644
--- a/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/constant_ops.mlir
+++ b/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/constant_ops.mlir
@@ -13,8 +13,8 @@
 
 // CHECK: vm.global.ref @pool_storage0_buffer init(@pool_storage0_buffer_initializer) : !vm.ref<!hal.buffer>
 hal.variable @pool_storage0_buffer init(@pool_storage0_buffer_initializer) : !hal.buffer attributes {sym_visibility = "private"}
-// CHECK: vm.func @pool_storage0_buffer_initializer() -> !vm.ref<!hal.buffer>
-func @pool_storage0_buffer_initializer() -> !hal.buffer attributes {sym_visibility = "private"} {
+// CHECK: vm.func private @pool_storage0_buffer_initializer() -> !vm.ref<!hal.buffer>
+func private @pool_storage0_buffer_initializer() -> !hal.buffer {
   %c0 = constant 0 : index
   %c16 = constant 16 : index
   %dev = hal.ex.shared_device : !hal.device
@@ -32,8 +32,8 @@
 
 // CHECK: vm.global.ref @pool_splats init(@pool_splats_initializer) : !vm.ref<!hal.buffer>
 hal.variable @pool_splats init(@pool_splats_initializer) : !hal.buffer attributes {sym_visibility = "private"}
-// CHECK: vm.func @pool_splats_initializer() -> !vm.ref<!hal.buffer>
-func @pool_splats_initializer() -> !hal.buffer attributes {sym_visibility = "private"} {
+// CHECK: vm.func private @pool_splats_initializer() -> !vm.ref<!hal.buffer>
+func private @pool_splats_initializer() -> !hal.buffer {
   %c64 = constant 64 : index
   %c0 = constant 0 : index
   %c4 = constant 4 : index
diff --git a/iree/compiler/Dialect/VM/Analysis/test/register_allocation.mlir b/iree/compiler/Dialect/VM/Analysis/test/register_allocation.mlir
index b9dfe09..6f0aea7 100644
--- a/iree/compiler/Dialect/VM/Analysis/test/register_allocation.mlir
+++ b/iree/compiler/Dialect/VM/Analysis/test/register_allocation.mlir
@@ -1,4 +1,4 @@
-// RUN: iree-opt -split-input-file -pass-pipeline='vm.module(test-iree-vm-register-allocation)' %s | IreeFileCheck %s
+// RUN: iree-opt -split-input-file -pass-pipeline='vm.module(vm.func(test-iree-vm-register-allocation))' %s | IreeFileCheck %s
 
 // CHECK-LABEL: @module
 vm.module @module {
diff --git a/iree/compiler/Dialect/VM/Analysis/test/value_liveness.mlir b/iree/compiler/Dialect/VM/Analysis/test/value_liveness.mlir
index 3997bab..755dc67 100644
--- a/iree/compiler/Dialect/VM/Analysis/test/value_liveness.mlir
+++ b/iree/compiler/Dialect/VM/Analysis/test/value_liveness.mlir
@@ -1,4 +1,4 @@
-// RUN: iree-opt -split-input-file -pass-pipeline='vm.module(test-iree-vm-value-liveness)' %s | IreeFileCheck %s
+// RUN: iree-opt -split-input-file -pass-pipeline='vm.module(vm.func(test-iree-vm-value-liveness))' %s | IreeFileCheck %s
 
 // CHECK-LABEL: @module
 vm.module @module {
diff --git a/third_party/llvm-project b/third_party/llvm-project
index c8d73d9..c30ab6c 160000
--- a/third_party/llvm-project
+++ b/third_party/llvm-project
@@ -1 +1 @@
-Subproject commit c8d73d939fa4fda9c87b3979225d02d63062bd68
+Subproject commit c30ab6c2a307cfdce8323ed94c3d70eb2d26bc14