From 890a79641e452b9d7144ceff9389bc6438b8f729 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 22 Apr 2021 22:55:48 -0700 Subject: [PATCH] Integrate LLVM at llvm/llvm-project@37e145812855 Updates LLVM usage to match [37e145812855](https://github.com/llvm/llvm-project/commit/37e145812855) PiperOrigin-RevId: 370020161 --- WORKSPACE | 4 ++-- build_tools/llvm_version.txt | 2 +- lib/Dialect/mhlo/transforms/mhlo_control_flow_to_scf.cc | 1 + lib/Dialect/mhlo/transforms/mhlo_fusion.cc | 1 + tests/chlo_legalize_to_hlo_broadcasts.mlir | 3 ++- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 77ae2ef..8047008 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,9 +15,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -LLVM_COMMIT = "2f69975683f5b6ea7df79f335f96b889a4bddecd" +LLVM_COMMIT = "37e1458128556ae153313cdb7e085907dff5bb8b" -LLVM_SHA256 = "9949f5055db2b59306fb2be23487c782df4870329652bbd98d6e5a65e4600b70" +LLVM_SHA256 = "e71a7ebad47c739e0aac8c8f8aded78bdcccf3fdaf1ec04a2731554b997b758b" LLVM_BAZEL_TAG = "llvm-project-{commit}".format(commit = LLVM_COMMIT) diff --git a/build_tools/llvm_version.txt b/build_tools/llvm_version.txt index 968f760..8987efd 100644 --- a/build_tools/llvm_version.txt +++ b/build_tools/llvm_version.txt @@ -1,2 +1,2 @@ -2f69975683f5b6ea7df79f335f96b889a4bddecd +37e1458128556ae153313cdb7e085907dff5bb8b diff --git a/lib/Dialect/mhlo/transforms/mhlo_control_flow_to_scf.cc b/lib/Dialect/mhlo/transforms/mhlo_control_flow_to_scf.cc index 907fd76..1b6b125 100644 --- a/lib/Dialect/mhlo/transforms/mhlo_control_flow_to_scf.cc +++ b/lib/Dialect/mhlo/transforms/mhlo_control_flow_to_scf.cc @@ -14,6 +14,7 @@ limitations under the License. ==============================================================================*/ #include "llvm/Support/Casting.h" +#include "llvm/Support/Debug.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h" #include "mlir-hlo/Dialect/mhlo/transforms/passes.h" #include "mlir/Dialect/SCF/SCF.h" diff --git a/lib/Dialect/mhlo/transforms/mhlo_fusion.cc b/lib/Dialect/mhlo/transforms/mhlo_fusion.cc index 99ac0ab..3dff7db 100644 --- a/lib/Dialect/mhlo/transforms/mhlo_fusion.cc +++ b/lib/Dialect/mhlo/transforms/mhlo_fusion.cc @@ -19,6 +19,7 @@ limitations under the License. #include #include "llvm/ADT/EquivalenceClasses.h" +#include "llvm/Support/Debug.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h" #include "mlir-hlo/utils/cycle_detector.h" #include "mlir/Dialect/StandardOps/IR/Ops.h" // TF:llvm-project diff --git a/tests/chlo_legalize_to_hlo_broadcasts.mlir b/tests/chlo_legalize_to_hlo_broadcasts.mlir index 4e4762f..d322d94 100644 --- a/tests/chlo_legalize_to_hlo_broadcasts.mlir +++ b/tests/chlo_legalize_to_hlo_broadcasts.mlir @@ -134,10 +134,11 @@ func @selectv2_broadcast_all(%arg0: tensor<8x1x1xi1>, %arg1: tensor<1x8x1xi32>, func @selectv2_dynamic_ranked(%arg0: tensor<1xi1>, %arg1: tensor<2x?x8xi32>, %arg2: tensor<2x8x8xi32>) -> tensor<2x?x8xi32> { // CHECK-NEXT: %[[SHAPE0:.*]] = shape.const_shape [1] : tensor // CHECK-NEXT: %[[SHAPE2:.*]] = shape.const_shape [2, 8, 8] : tensor + // CHECK-NEXT: %[[PARTIALLY_FOLDED_BCAST:.*]] = constant dense<[2, 8, 8]> : tensor<3xindex> // CHECK-NEXT: %[[SHAPE1:.*]] = shape.shape_of %arg1 : tensor<2x?x8xi32> -> tensor // CHECK-NEXT: %[[CSTR:.*]] = shape.cstr_broadcastable %[[SHAPE1]], %[[SHAPE0]], %[[SHAPE2]] : tensor, tensor, tensor // CHECK-NEXT: %[[ASSUME:.*]] = shape.assuming %[[CSTR]] -> (tensor<2x?x8xi32>) { - // CHECK-NEXT: %[[BCST_V:.*]] = shape.broadcast %[[SHAPE1]], %[[SHAPE0]], %[[SHAPE2]] : tensor, tensor, tensor -> tensor + // CHECK-NEXT: %[[BCST_V:.*]] = shape.broadcast %[[SHAPE1]], %[[PARTIALLY_FOLDED_BCAST]] : tensor, tensor<3xindex> -> tensor // CHECK-NEXT: %[[BCST:.*]] = tensor.cast %[[BCST_V]] : tensor to tensor<3xindex> // CHECK-NEXT: %[[BCST0:.*]] = "mhlo.dynamic_broadcast_in_dim"(%arg0, %[[BCST]]) {broadcast_dimensions = dense<2> : tensor<1xi64>} : (tensor<1xi1>, tensor<3xindex>) -> tensor<2x?x8xi1> // CHECK-NEXT: %[[BCST1:.*]] = "mhlo.dynamic_broadcast_in_dim"(%arg1, %[[BCST]]) {broadcast_dimensions = dense<[0, 1, 2]> : tensor<3xi64>} : (tensor<2x?x8xi32>, tensor<3xindex>) -> tensor<2x?x8xi32>