Merge pull request #4125 from hanhanW:main-to-google

PiperOrigin-RevId: 346420314
diff --git a/SUBMODULE_VERSIONS b/SUBMODULE_VERSIONS
index 5175f53..4475e30 100644
--- a/SUBMODULE_VERSIONS
+++ b/SUBMODULE_VERSIONS
@@ -4,8 +4,8 @@
 4c13807b7d43ff0946b7ffea0ae3aee9e611d778 third_party/dear_imgui
 4fb0ff7069bd88ee85902f4d0bb62794e5f6d021 third_party/flatcc
 b1fbd33c06cdb0024c67733c6fdec2009d17b384 third_party/googletest
-045e2f7267c28b85984f73a362315b7396450c91 third_party/llvm-bazel
-2ac4d0f45a2a301163ca53f3e23e675f4f5bdbd3 third_party/llvm-project
+bfc60e6cfe4d298f1662042f21f55c0ddd409749 third_party/llvm-bazel
+d553243fe4b5e1992c07aff7b54b16160a4d5e97 third_party/llvm-project
 55801f03f9cc69abfcf8b508a873f702c11b3b5f third_party/mlir-emitc
 74d7261be17cf659d5930d4830609406bd7553e3 third_party/pffft
 d8c7ee00a687ac369e62e2032514a93a9b413502 third_party/pybind11
@@ -13,7 +13,7 @@
 a1390ed39ec77ecfb574bc6fcd5bfc5e3adbdea9 third_party/sdl2
 685f86471e9d26b3eb7676695a2e2cefb4551ae9 third_party/spirv_cross
 f8bf11a0253a32375c32cad92c841237b96696c0 third_party/spirv_headers
-d91f92e7fd1bcc8c1af2c25649ee58c18bef0a9a third_party/tensorflow
+49d9c97061d3ff3d957af4d60d8a1ad701a5d106 third_party/tensorflow
 9c3dac3ed2bd647b8d63f197fed058fee97a7e1e third_party/tracy
 9bd3f561bcee3f01d22912de10bb07ce4e23d378 third_party/vulkan_headers
 3528e2aed3e8808f33e1e7d63eeb1560456a605a third_party/vulkan_memory_allocator
diff --git a/iree/compiler/Conversion/LinalgToSPIRV/ConvertToSPIRVPass.cpp b/iree/compiler/Conversion/LinalgToSPIRV/ConvertToSPIRVPass.cpp
index 327bb5a..4650052 100644
--- a/iree/compiler/Conversion/LinalgToSPIRV/ConvertToSPIRVPass.cpp
+++ b/iree/compiler/Conversion/LinalgToSPIRV/ConvertToSPIRVPass.cpp
@@ -512,7 +512,7 @@
       moduleOp.getLoc(), spirv::AddressingModel::Logical,
       spirv::MemoryModel::GLSL450);
   Operation *terminator = spvModule.getBlock().getTerminator();
-  Dialect *spvDialect = spvModule.getDialect();
+  Dialect *spvDialect = spvModule->getDialect();
   for (Operation &op : llvm::make_early_inc_range(*moduleOp.getBody())) {
     // Skip the newly created spv.module itself.
     if (&op == spvModule) continue;
diff --git a/iree/compiler/Conversion/LinalgToSPIRV/SplitDispatchFunctionPass.cpp b/iree/compiler/Conversion/LinalgToSPIRV/SplitDispatchFunctionPass.cpp
index 2b2642c..22983f3 100644
--- a/iree/compiler/Conversion/LinalgToSPIRV/SplitDispatchFunctionPass.cpp
+++ b/iree/compiler/Conversion/LinalgToSPIRV/SplitDispatchFunctionPass.cpp
@@ -238,7 +238,7 @@
   }
   if (fusedOpsList.size() <= 1) return success();
 
-  ModuleOp moduleOp = cast<ModuleOp>(oldFn.getParentOp());
+  ModuleOp moduleOp = cast<ModuleOp>(oldFn->getParentOp());
   Block &oldFnBlock = oldFn.getBlocks().front();
   Location loc = oldFn.getLoc();
 
diff --git a/iree/compiler/Dialect/Flow/IR/FlowOps.cpp b/iree/compiler/Dialect/Flow/IR/FlowOps.cpp
index 53b3703..682314a 100644
--- a/iree/compiler/Dialect/Flow/IR/FlowOps.cpp
+++ b/iree/compiler/Dialect/Flow/IR/FlowOps.cpp
@@ -648,7 +648,7 @@
   state.addOperands(operands);
   // Construct Executable::Entry nested reference.
   StringRef executableOpSymName =
-      entryPoint.getParentOp()
+      entryPoint->getParentOp()
           ->getAttrOfType<StringAttr>(SymbolTable::getSymbolAttrName())
           .getValue();
   state.addAttribute(
diff --git a/iree/compiler/Dialect/Flow/Transforms/FlattenTuplesInCFG.cpp b/iree/compiler/Dialect/Flow/Transforms/FlattenTuplesInCFG.cpp
index 86f886a..b244c3d 100644
--- a/iree/compiler/Dialect/Flow/Transforms/FlattenTuplesInCFG.cpp
+++ b/iree/compiler/Dialect/Flow/Transforms/FlattenTuplesInCFG.cpp
@@ -306,7 +306,7 @@
           builder.getFunctionType(newInputTypes, newResultTypes);
       auto newFunction =
           FuncOp::create(oldFunction.getLoc(), oldFunction.getName(),
-                         newFunctionType, oldFunction.getDialectAttrs());
+                         newFunctionType, oldFunction->getDialectAttrs());
       convertedFunctions.push_back({oldFunction, newFunction});
 
       // Perform the actual body conversion now that we have proper signatures.
diff --git a/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/ConvertVariableOps.cpp b/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/ConvertVariableOps.cpp
index d36b62c..aa637e7 100644
--- a/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/ConvertVariableOps.cpp
+++ b/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/ConvertVariableOps.cpp
@@ -80,7 +80,7 @@
     auto newOp = rewriter.create<IREE::HAL::VariableOp>(
         variableOp.getLoc(), variableOp.sym_name(), variableOp.is_mutable(),
         converter.convertType(variableOp.type()), initializer, initialValue,
-        llvm::to_vector<4>(variableOp.getDialectAttrs()));
+        llvm::to_vector<4>(variableOp->getDialectAttrs()));
     newOp.setVisibility(variableOp.getVisibility());
     rewriter.replaceOp(variableOp, {});
     return success();
diff --git a/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertVariableOps.cpp b/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertVariableOps.cpp
index adbb2c3..9928153 100644
--- a/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertVariableOps.cpp
+++ b/iree/compiler/Dialect/HAL/Conversion/HALToVM/ConvertVariableOps.cpp
@@ -35,17 +35,17 @@
         IREE::VM::RefType::isCompatible(convertedType)) {
       rewriter.replaceOpWithNewOp<IREE::VM::GlobalRefOp>(
           op, op.sym_name(), op.is_mutable(), convertedType, op.initializer(),
-          op.initial_value(), llvm::to_vector<4>(op.getDialectAttrs()));
+          op.initial_value(), llvm::to_vector<4>(op->getDialectAttrs()));
       return success();
     } else if (convertedType.isInteger(32)) {
       rewriter.replaceOpWithNewOp<IREE::VM::GlobalI32Op>(
           op, op.sym_name(), op.is_mutable(), convertedType, op.initializer(),
-          op.initial_value(), llvm::to_vector<4>(op.getDialectAttrs()));
+          op.initial_value(), llvm::to_vector<4>(op->getDialectAttrs()));
       return success();
     } else if (convertedType.isInteger(64)) {
       rewriter.replaceOpWithNewOp<IREE::VM::GlobalI64Op>(
           op, op.sym_name(), op.is_mutable(), convertedType, op.initializer(),
-          op.initial_value(), llvm::to_vector<4>(op.getDialectAttrs()));
+          op.initial_value(), llvm::to_vector<4>(op->getDialectAttrs()));
       return success();
     }
     return op.emitOpError("unsupported variable type");
diff --git a/iree/compiler/Dialect/HAL/IR/HALOps.cpp b/iree/compiler/Dialect/HAL/IR/HALOps.cpp
index 9bf155b..e6cfd96 100644
--- a/iree/compiler/Dialect/HAL/IR/HALOps.cpp
+++ b/iree/compiler/Dialect/HAL/IR/HALOps.cpp
@@ -905,14 +905,14 @@
   state.addOperands({commandBuffer, workgroupX, workgroupY, workgroupZ});
   // Construct Executable::Target::EntryPoint nested reference.
   StringRef executableOpSymName =
-      entryPoint.getParentOp()
+      entryPoint->getParentOp()
           ->getParentOp()
           ->getAttrOfType<StringAttr>(SymbolTable::getSymbolAttrName())
           .getValue();
   state.addAttribute("entry_point",
                      builder.getSymbolRefAttr(
                          executableOpSymName,
-                         {builder.getSymbolRefAttr(entryPoint.getParentOp()),
+                         {builder.getSymbolRefAttr(entryPoint->getParentOp()),
                           builder.getSymbolRefAttr(entryPoint)}));
 }
 
diff --git a/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp b/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp
index 5f2747e..01b7f87 100644
--- a/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp
+++ b/iree/compiler/Dialect/HAL/Transforms/MaterializeInterfaces.cpp
@@ -149,7 +149,7 @@
                                     clonedFuncOp.getName(), thunkFuncType);
   clonedFuncOp.setName((clonedFuncOp.getName() + "_impl").str());
   clonedFuncOp.setPrivate();
-  clonedFuncOp.getParentRegion()->getBlocks().front().push_front(thunkFuncOp);
+  clonedFuncOp->getParentRegion()->getBlocks().front().push_front(thunkFuncOp);
 
   // For now we only support tensor types, so bindings are in order.
   // In the future we will want to provide N:M mappings (as well as the
diff --git a/iree/compiler/Dialect/HAL/Transforms/ResolveEntryPointOrdinals.cpp b/iree/compiler/Dialect/HAL/Transforms/ResolveEntryPointOrdinals.cpp
index 35b3d1e..77981ca 100644
--- a/iree/compiler/Dialect/HAL/Transforms/ResolveEntryPointOrdinals.cpp
+++ b/iree/compiler/Dialect/HAL/Transforms/ResolveEntryPointOrdinals.cpp
@@ -38,7 +38,7 @@
         op.getLoc(), IREE::HAL::DeviceType::get(rewriter.getContext()),
         op.command_buffer());
     auto executableOp = dyn_cast<IREE::HAL::ExecutableOp>(
-        entryPointOp.getParentOp()->getParentOp());
+        entryPointOp->getParentOp()->getParentOp());
     auto executable = rewriter.createOrFold<IREE::HAL::ExecutableLookupOp>(
         op.getLoc(), device, executableOp.sym_name());
 
@@ -67,7 +67,7 @@
         op.getLoc(), IREE::HAL::DeviceType::get(rewriter.getContext()),
         op.command_buffer());
     auto executableOp = dyn_cast<IREE::HAL::ExecutableOp>(
-        entryPointOp.getParentOp()->getParentOp());
+        entryPointOp->getParentOp()->getParentOp());
     auto executable = rewriter.createOrFold<IREE::HAL::ExecutableLookupOp>(
         op.getLoc(), device, executableOp.sym_name());
 
diff --git a/iree/compiler/Dialect/VM/Conversion/ConversionTarget.cpp b/iree/compiler/Dialect/VM/Conversion/ConversionTarget.cpp
index 8f1eaec..a0b9cdc 100644
--- a/iree/compiler/Dialect/VM/Conversion/ConversionTarget.cpp
+++ b/iree/compiler/Dialect/VM/Conversion/ConversionTarget.cpp
@@ -40,11 +40,11 @@
   // NOTE: we need to allow the outermost std.module to be legal to support the
   // double-nesting (module { vm.module { ... } }).
   addDynamicallyLegalOp<mlir::ModuleOp>(+[](mlir::ModuleOp op) {
-    return !op.getParentOp() || !isa<ModuleOp>(op.getParentOp());
+    return !op->getParentOp() || !isa<ModuleOp>(op->getParentOp());
   });
   addDynamicallyLegalOp<mlir::ModuleTerminatorOp>(
       +[](mlir::ModuleTerminatorOp op) {
-        return !isa<IREE::VM::ModuleOp>(op.getParentOp());
+        return !isa<IREE::VM::ModuleOp>(op->getParentOp());
       });
 }
 
diff --git a/iree/compiler/Dialect/VM/Conversion/StandardToVM/ConvertStandardToVM.cpp b/iree/compiler/Dialect/VM/Conversion/StandardToVM/ConvertStandardToVM.cpp
index 70d703d..c37e479 100644
--- a/iree/compiler/Dialect/VM/Conversion/StandardToVM/ConvertStandardToVM.cpp
+++ b/iree/compiler/Dialect/VM/Conversion/StandardToVM/ConvertStandardToVM.cpp
@@ -38,7 +38,7 @@
       ConversionPatternRewriter &rewriter) const override {
     // Do not attempt to convert the top level module.
     // This mechanism can only support rewriting non top-level modules.
-    if (!srcOp.getParentOp() || !isa<ModuleOp>(srcOp.getParentOp())) {
+    if (!srcOp->getParentOp() || !isa<ModuleOp>(srcOp->getParentOp())) {
       return failure();
     }
 
@@ -67,7 +67,7 @@
       ConversionPatternRewriter &rewriter) const override {
     // Do not attempt to convert the top level module's terminator.
     // This mechanism can only support rewriting non top-level modules.
-    if (!isa<IREE::VM::ModuleOp>(srcOp.getParentOp())) {
+    if (!isa<IREE::VM::ModuleOp>(srcOp->getParentOp())) {
       return failure();
     }
     rewriter.replaceOpWithNewOp<IREE::VM::ModuleTerminatorOp>(srcOp);
diff --git a/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp b/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp
index 0f97aae..4dfbbc0 100644
--- a/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp
+++ b/iree/compiler/Dialect/VM/IR/VMOpFolders.cpp
@@ -109,7 +109,7 @@
     if (value.getValue() != 0) return failure();
     rewriter.replaceOpWithNewOp<T>(op, op.sym_name(), op.is_mutable(),
                                    op.type(),
-                                   llvm::to_vector<4>(op.getDialectAttrs()));
+                                   llvm::to_vector<4>(op->getDialectAttrs()));
     return success();
   }
 };
diff --git a/third_party/llvm-bazel b/third_party/llvm-bazel
index 045e2f7..bfc60e6 160000
--- a/third_party/llvm-bazel
+++ b/third_party/llvm-bazel
@@ -1 +1 @@
-Subproject commit 045e2f7267c28b85984f73a362315b7396450c91
+Subproject commit bfc60e6cfe4d298f1662042f21f55c0ddd409749
diff --git a/third_party/llvm-project b/third_party/llvm-project
index 2ac4d0f..d553243 160000
--- a/third_party/llvm-project
+++ b/third_party/llvm-project
@@ -1 +1 @@
-Subproject commit 2ac4d0f45a2a301163ca53f3e23e675f4f5bdbd3
+Subproject commit d553243fe4b5e1992c07aff7b54b16160a4d5e97
diff --git a/third_party/tensorflow b/third_party/tensorflow
index d91f92e..49d9c97 160000
--- a/third_party/tensorflow
+++ b/third_party/tensorflow
@@ -1 +1 @@
-Subproject commit d91f92e7fd1bcc8c1af2c25649ee58c18bef0a9a
+Subproject commit 49d9c97061d3ff3d957af4d60d8a1ad701a5d106