Updates LLVM usage to match
[c85b6bf33c47](https://github.com/llvm/llvm-project/commit/c85b6bf33c47)

PiperOrigin-RevId: 354136678
This commit is contained in:
A. Unique TensorFlower 2021-01-27 11:44:24 -08:00 committed by TensorFlow MLIR Team
parent d77c9ad6fa
commit c653db73c5
3 changed files with 9 additions and 12 deletions

View File

@ -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)

View File

@ -1,2 +1,2 @@
f3f3c9c2549a268e602be8730990b552e30cc932
c85b6bf33c473633c9873b600f8a31fa55464e1e

View File

@ -284,7 +284,7 @@ class HloToLhloDynamicBroadcastInDimOpConverter
}
}
SmallVector<Value, 2> sizes, strides;
SmallVector<OpFoldResult, 2> 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<CmpIOp>(
loc, CmpIPredicate::slt, operand_sizes[dim], result_dim_size);
strides.push_back(b->create<mlir::SelectOp>(loc, is_expansion, zero,
operand_strides[dim]));
Value select = b->create<mlir::SelectOp>(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<int64_t, 2> static_sizes(sizes.size(),
ShapedType::kDynamicSize);
SmallVector<int64_t, 2> static_strides(strides.size(),
ShapedType::kDynamicStrideOrOffset);
auto transformed_operand = b->create<MemRefReinterpretCastOp>(
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;
}