Integrate llvm-project at 0389f2edf7c252e49323ae0ca6adfea9f2614f6d (#8371)

* Integrate llvm-project at 0389f2edf7c252e49323ae0ca6adfea9f2614f6d

* Reset third_party/llvm-project: 0389f2edf7c252e49323ae0ca6adfea9f2614f6d (2022-02-17 02:17:27 -0800): Revert "[compiler-rt] Implement  ARM atomic operations for architectures without SMP support"

* Advance sub-projects:
  tensorflow: 557d0e3d21bf1b0b2b1c6045e266b2a7a6d6f2ab
  mlir-hlo: bc33872cc655c88d30718fe0dffe5daa45139e54
  Piper CL: 429516974

* Fix build breakages due to
    - Vector dialect flipped to prefixed form (75044e9b4f20d025295dbd56284435937cfb4de5)
    - change in `getResult` signature due to b077ee9240f8b603d1dc8b43628fee0d4b94e963

* Disable emitc static_library sample pending resolution of https://github.com/google/iree/issues/8380

Co-authored-by: Stella Laurenzo <stellaraccident@gmail.com>
diff --git a/integrations/tensorflow/WORKSPACE b/integrations/tensorflow/WORKSPACE
index 2b12eae..499e9d4 100644
--- a/integrations/tensorflow/WORKSPACE
+++ b/integrations/tensorflow/WORKSPACE
@@ -7,7 +7,7 @@
 
 load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
 
-TENSORFLOW_COMMIT = "cfb70d44f699ed4f005b8ba35110273e83337220"
+TENSORFLOW_COMMIT = "557d0e3d21bf1b0b2b1c6045e266b2a7a6d6f2ab"
 
 git_repository(
     name = "org_tensorflow",
diff --git a/iree/compiler/Codegen/Common/VectorizeConv.cpp b/iree/compiler/Codegen/Common/VectorizeConv.cpp
index 2a1bcf1..8f89aca 100644
--- a/iree/compiler/Codegen/Common/VectorizeConv.cpp
+++ b/iree/compiler/Codegen/Common/VectorizeConv.cpp
@@ -201,7 +201,7 @@
           // Write out the output vector.
           auto writeOp = rewriter.create<vector::TransferWriteOp>(
               loc, outputVector, outputWrite, outputIndices);
-          if (hasTensorSemantics) outputWrite = writeOp.getResult(0);
+          if (hasTensorSemantics) outputWrite = writeOp.getResult();
         }
       }
     }
@@ -343,7 +343,7 @@
           // Write out the output vector.
           auto writeOp = rewriter.create<vector::TransferWriteOp>(
               loc, outputVector, outputWrite, outputIndices);
-          if (hasTensorSemantics) outputWrite = writeOp.getResult(0);
+          if (hasTensorSemantics) outputWrite = writeOp.getResult();
         }
       }
     }
diff --git a/iree/compiler/Codegen/Common/VectorizeMMT4d.cpp b/iree/compiler/Codegen/Common/VectorizeMMT4d.cpp
index 3fc9764..5dee86f 100644
--- a/iree/compiler/Codegen/Common/VectorizeMMT4d.cpp
+++ b/iree/compiler/Codegen/Common/VectorizeMMT4d.cpp
@@ -130,7 +130,7 @@
         rewriter
             .create<vector::TransferWriteOp>(loc, contractResult, dst2D,
                                              ValueRange{c0, c0}, identityMap2D)
-            .getResult(0);
+            .getResult();
     Value insertSlice = tensor::createCanonicalRankReducingInsertSliceOp(
         rewriter, loc, contractResultTensor, dst);
     rewriter.replaceOp(mmt4DOp, insertSlice);
diff --git a/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp b/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp
index 1bfa162..5ce1281 100644
--- a/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp
+++ b/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp
@@ -62,7 +62,7 @@
   const int NIter = parallel_iterators[1];
   const int KIter = reduction_iterators[0];
   // Check that there are 3 indexing maps.
-  auto indexingMaps = contractionOp.indexing_maps().getValue();
+  auto indexingMaps = contractionOp.indexing_maps();
   if (indexingMaps.size() != 3) {
     return false;
   }
@@ -70,7 +70,7 @@
   const int expectedMapResults[3][2] = {
       {MIter, KIter}, {NIter, KIter}, {MIter, NIter}};
   for (int m = 0; m < 3; ++m) {
-    auto map = indexingMaps[m].cast<AffineMapAttr>().getValue();
+    auto map = indexingMaps[m];
     if (map.getNumDims() != 3 || map.getNumResults() != 2) {
       return false;
     }
diff --git a/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp b/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp
index c0f32a7..321ad57 100644
--- a/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp
+++ b/iree/compiler/Codegen/SPIRV/SPIRVTileAndVectorizeToCooperativeOps.cpp
@@ -233,8 +233,7 @@
     SmallVector<AffineMap> newMaps;
     SmallVector<Value> newSources;
     for (auto source : llvm::enumerate(sources)) {
-      auto map =
-          op.indexing_maps()[source.index()].cast<AffineMapAttr>().getValue();
+      auto map = op.indexing_maps()[source.index()];
       auto tranposeOp = source.value().getDefiningOp<vector::TransposeOp>();
       if (!tranposeOp) {
         newSources.push_back(source.value());
diff --git a/iree/compiler/Codegen/SPIRV/SPIRVVectorToCooperativeOps.cpp b/iree/compiler/Codegen/SPIRV/SPIRVVectorToCooperativeOps.cpp
index abb6328..49a57a5 100644
--- a/iree/compiler/Codegen/SPIRV/SPIRVVectorToCooperativeOps.cpp
+++ b/iree/compiler/Codegen/SPIRV/SPIRVVectorToCooperativeOps.cpp
@@ -132,7 +132,7 @@
 
     // Column major matmuls should have been lowered to transpose + contract
     // by this point. Transpose can be handled by load/store operations.
-    if (!isRowMajorMatmul(contractOp.indexing_maps())) return failure();
+    if (!isRowMajorMatmul(contractOp.indexing_mapsAttr())) return failure();
 
     rewriter.replaceOpWithNewOp<spirv::CooperativeMatrixMulAddNVOp>(
         contractOp, operands.acc().getType(), operands.lhs(), operands.rhs(),
diff --git a/iree/samples/static_library/CMakeLists.txt b/iree/samples/static_library/CMakeLists.txt
index cd46e87..0193497 100644
--- a/iree/samples/static_library/CMakeLists.txt
+++ b/iree/samples/static_library/CMakeLists.txt
@@ -10,6 +10,9 @@
   return()
 endif()
 
+# TODO: Re-enable once bug fixed (https://github.com/google/iree/issues/8380)
+return()
+
 # Set iree-translate binary.
 set(_TRANSLATE_TOOL_EXECUTABLE $<TARGET_FILE:iree_tools_iree-translate>)
 
diff --git a/third_party/llvm-project b/third_party/llvm-project
index cb7ee72..0389f2e 160000
--- a/third_party/llvm-project
+++ b/third_party/llvm-project
@@ -1 +1 @@
-Subproject commit cb7ee7289b7dea86c25027f2a36afededb8a568b
+Subproject commit 0389f2edf7c252e49323ae0ca6adfea9f2614f6d
diff --git a/third_party/mlir-hlo b/third_party/mlir-hlo
index 46e9a52..bc33872 160000
--- a/third_party/mlir-hlo
+++ b/third_party/mlir-hlo
@@ -1 +1 @@
-Subproject commit 46e9a52048c2e82ed746c2e086a371a530618f14
+Subproject commit bc33872cc655c88d30718fe0dffe5daa45139e54