Merge pull request #4421 from KoolJBlack/google-to-main

* d6fa00dd Format ConvertToLLVM2.cpp.
* 4fc1a352 Merge pull request #4413 from KoolJBlack:main-to-google
* 594e06cb Merge branch 'google' into main-to-google
* 0c7d6512 Synchronize submodules
* 78170d0a Synchronize submodules with LLVM at llvm/llvm-project@d38a0258a5f4
* 7725556c Synchronize submodules
* 4c8cfe75 Integrate LLVM at llvm/llvm-project@7f7b0dc4e15f
* 14fbe4d9 Synchronize submodules
* f606a8e6 Integrate LLVM at llvm/llvm-project@d38a0258a5f4
* 3ac7e078 Update from StrJoin to !interleave
diff --git a/SUBMODULE_VERSIONS b/SUBMODULE_VERSIONS
index 7d61491..9c473f3 100644
--- a/SUBMODULE_VERSIONS
+++ b/SUBMODULE_VERSIONS
@@ -4,8 +4,8 @@
 4fb0ff7069bd88ee85902f4d0bb62794e5f6d021 third_party/flatcc
 b1fbd33c06cdb0024c67733c6fdec2009d17b384 third_party/googletest
 88b845dee001723c4a0db1fe5477de735b6d3bb0 third_party/liburing
-4c8b546e53eebc708c77ba19a2110926a8732642 third_party/llvm-bazel
-8bee4d4e8f54b5f28b9117b552d3b2c655ff129b third_party/llvm-project
+3910ce2f0d2f035606ad522cfcc639232da32a40 third_party/llvm-bazel
+7f7b0dc4e15fac5f91f8f6dcc7f91c9025f41ae0 third_party/llvm-project
 62e6df5c107db04d08ee392293a53552ab3d01c1 third_party/mlir-emitc
 5a080ad795fb38d993891ecb0db8344c476823f6 third_party/mlir-hlo
 74d7261be17cf659d5930d4830609406bd7553e3 third_party/pffft
@@ -13,7 +13,7 @@
 d79362c24fd70eab3196672273dbfd8f0dd6124c third_party/ruy
 685f86471e9d26b3eb7676695a2e2cefb4551ae9 third_party/spirv_cross
 f8bf11a0253a32375c32cad92c841237b96696c0 third_party/spirv_headers
-c66a221d8b49b8e397f1bd58aac01371e282410f third_party/tensorflow
+47881168636b8fbd6f01f1d78b31cf11e7973113 third_party/tensorflow
 9c3dac3ed2bd647b8d63f197fed058fee97a7e1e third_party/tracy
 9bd3f561bcee3f01d22912de10bb07ce4e23d378 third_party/vulkan_headers
 3528e2aed3e8808f33e1e7d63eeb1560456a605a third_party/vulkan_memory_allocator
diff --git a/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM.cpp b/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM.cpp
index 35e8d7f..dc16e87 100644
--- a/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM.cpp
+++ b/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM.cpp
@@ -228,7 +228,7 @@
     // A map from binding ops to their corresponding function argument indices.
     llvm::DenseMap<Operation *, unsigned> bindingArgMap;
     llvm::SmallVector<MemRefType, 4> inputMemRefTypes;
-    llvm::SmallVector<LLVM::LLVMType, 4> inputStructPtrs;
+    llvm::SmallVector<Type, 4> inputStructPtrs;
     unsigned argIndex = 0;
     for (auto bufferOp : bufferOps) {
       auto binding = bufferBindingMap[bufferOp];
@@ -243,9 +243,10 @@
 
       auto memrefType = bufferOp.getType().dyn_cast_or_null<MemRefType>();
       inputMemRefTypes.push_back(memrefType);
-      auto elementType = typeConverter->convertType(memrefType.getElementType())
-                             .dyn_cast<LLVM::LLVMType>();
-      if (!elementType) return failure();
+      auto elementType =
+          typeConverter->convertType(memrefType.getElementType());
+      if (!elementType || !LLVM::isCompatibleType(elementType))
+        return failure();
       inputStructPtrs.push_back(
           LLVM::LLVMPointerType::get(elementType, memrefType.getMemorySpace()));
     }
diff --git a/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM2.cpp b/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM2.cpp
index eb658fb..6cb31b2 100644
--- a/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM2.cpp
+++ b/iree/compiler/Conversion/LinalgToLLVM/ConvertToLLVM2.cpp
@@ -101,8 +101,8 @@
         LLVM::LLVMPointerType::get(LLVM::LLVMIntegerType::get(context, 32));
     signatureConverter.addInputs(
         {packedBuffersArgsTy, pushConstantArgTy, xyzTy, xyzTy, xyzTy});
-    SmallVector<LLVM::LLVMType, 5> llvmInputTypes{
-        packedBuffersArgsTy, pushConstantArgTy, xyzTy, xyzTy, xyzTy};
+    SmallVector<Type, 5> llvmInputTypes{packedBuffersArgsTy, pushConstantArgTy,
+                                        xyzTy, xyzTy, xyzTy};
 
     // Construct newFunc with all attributes except return type & symbol name.
     SmallVector<NamedAttribute, 4> funcAttrs;
@@ -160,9 +160,7 @@
     if (!parentFuncOp) return failure();
 
     assert(parentFuncOp.getNumArguments() > 0 &&
-           parentFuncOp.getArgument(kIndexPackedBuffer)
-               .getType()
-               .isa<LLVM::LLVMType>());
+           parentFuncOp.getArgument(kIndexPackedBuffer).getType().isa<Type>());
 
     Location loc = op->getLoc();
     auto interfaceBindingSubspanOp =
diff --git a/iree/compiler/Dialect/IREE/IR/IREEBase.td b/iree/compiler/Dialect/IREE/IR/IREEBase.td
index 2830a12..83d4cc1 100644
--- a/iree/compiler/Dialect/IREE/IR/IREEBase.td
+++ b/iree/compiler/Dialect/IREE/IR/IREEBase.td
@@ -108,7 +108,7 @@
   // Generate a builder call if all of the elements are buildable.
   let builderCall = !if(!eq(AreTupleElementsBuildable<elements>.ret, 0),
     "", "$_builder.getTupleType({" #
-        StrJoin<!foreach(t, elements, t.type.builderCall)>.result # "})"
+        !interleave(!foreach(t, elements, t.type.builderCall), ", ") # "})"
   );
 }
 
@@ -172,7 +172,7 @@
               "$_self",
               "$_self.cast<IREE::PtrType>().getTargetType()",
               type.predicate>)>,
-    ]>, StrJoin<!foreach(type, types, type.description), " or ">.result> {
+    ]>, !interleave(!foreach(type, types, type.description), " or ")> {
   string builderCall = "";
 }
 
diff --git a/third_party/llvm-bazel b/third_party/llvm-bazel
index 4c8b546..3910ce2 160000
--- a/third_party/llvm-bazel
+++ b/third_party/llvm-bazel
@@ -1 +1 @@
-Subproject commit 4c8b546e53eebc708c77ba19a2110926a8732642
+Subproject commit 3910ce2f0d2f035606ad522cfcc639232da32a40
diff --git a/third_party/llvm-project b/third_party/llvm-project
index 8bee4d4..7f7b0dc 160000
--- a/third_party/llvm-project
+++ b/third_party/llvm-project
@@ -1 +1 @@
-Subproject commit 8bee4d4e8f54b5f28b9117b552d3b2c655ff129b
+Subproject commit 7f7b0dc4e15fac5f91f8f6dcc7f91c9025f41ae0
diff --git a/third_party/tensorflow b/third_party/tensorflow
index c66a221..4788116 160000
--- a/third_party/tensorflow
+++ b/third_party/tensorflow
@@ -1 +1 @@
-Subproject commit c66a221d8b49b8e397f1bd58aac01371e282410f
+Subproject commit 47881168636b8fbd6f01f1d78b31cf11e7973113