From c653db73c512364322faf260e067815474736bab Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 27 Jan 2021 11:44:24 -0800 Subject: [PATCH] Integrate LLVM at llvm/llvm-project@c85b6bf33c47 Updates LLVM usage to match [c85b6bf33c47](https://github.com/llvm/llvm-project/commit/c85b6bf33c47) PiperOrigin-RevId: 354136678 --- WORKSPACE | 4 ++-- build_tools/llvm_version.txt | 2 +- .../mhlo/transforms/hlo_legalize_to_lhlo.cc | 15 ++++++--------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 18b16fa..8646b46 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,9 +15,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -LLVM_COMMIT = "f3f3c9c2549a268e602be8730990b552e30cc932" +LLVM_COMMIT = "c85b6bf33c473633c9873b600f8a31fa55464e1e" -LLVM_SHA256 = "3faf880bf9562c9b63de8b7d2f15146e2e691a471f66903bc07c29ffaf6b9df3" +LLVM_SHA256 = "21710892f964bd781f95b559741264b026580e3544c500782b69b63f00b1c68d" 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 f034dd8..6134749 100644 --- a/build_tools/llvm_version.txt +++ b/build_tools/llvm_version.txt @@ -1,2 +1,2 @@ -f3f3c9c2549a268e602be8730990b552e30cc932 +c85b6bf33c473633c9873b600f8a31fa55464e1e diff --git a/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc b/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc index 2b606cf..bb5c0c8 100644 --- a/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc +++ b/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc @@ -284,7 +284,7 @@ class HloToLhloDynamicBroadcastInDimOpConverter } } - SmallVector sizes, strides; + SmallVector sizes, strides; sizes.reserve(result_rank); strides.reserve(result_rank); @@ -319,8 +319,9 @@ class HloToLhloDynamicBroadcastInDimOpConverter int dim = it->second; Value is_expansion = b->create( loc, CmpIPredicate::slt, operand_sizes[dim], result_dim_size); - strides.push_back(b->create(loc, is_expansion, zero, - operand_strides[dim])); + Value select = b->create(loc, is_expansion, zero, + operand_strides[dim]); + strides.push_back(select); } // Type-erased memref type with static rank, dynamic sizes and strides. @@ -333,13 +334,9 @@ class HloToLhloDynamicBroadcastInDimOpConverter makeStridedLinearLayoutMap(dynamic_layout, /*offset=*/0, b->getContext())); - SmallVector static_sizes(sizes.size(), - ShapedType::kDynamicSize); - SmallVector static_strides(strides.size(), - ShapedType::kDynamicStrideOrOffset); auto transformed_operand = b->create( - loc, type_erased_memref_type, operand, /*offset=*/0, static_sizes, - static_strides, llvm::None, sizes, strides); + loc, type_erased_memref_type, operand, + /*offset=*/b->getI64IntegerAttr(0), sizes, strides); return transformed_operand; }