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

PiperOrigin-RevId: 380647265
This commit is contained in:
A. Unique TensorFlower 2021-06-21 13:07:29 -07:00 committed by TensorFlow MLIR Team
parent 03d2cb606d
commit 8ff5f9d94a
4 changed files with 16 additions and 16 deletions

View File

@ -15,9 +15,9 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
LLVM_COMMIT = "b650778dc4acbab8a5415e743604a2a0afabea3d" LLVM_COMMIT = "186f2ac612ad3cd551dee649e3097f4284774ba0"
LLVM_SHA256 = "e406c4f09390dbfc534cad73122345b0b7e678968d911c1e97823457f9d7ac70" LLVM_SHA256 = "85807f6c21cc5a79584e0d80d57292e3b001e2c96a784d00a0418918fae616c9"
LLVM_BAZEL_TAG = "llvm-project-{commit}".format(commit = LLVM_COMMIT) LLVM_BAZEL_TAG = "llvm-project-{commit}".format(commit = LLVM_COMMIT)

View File

@ -1,2 +1,2 @@
b650778dc4acbab8a5415e743604a2a0afabea3d 186f2ac612ad3cd551dee649e3097f4284774ba0

View File

@ -1270,8 +1270,8 @@ class SliceConverter : public OpConversionPattern<OpTy> {
rewriter.create<linalg::CopyOp>(loc, linalg_op, args[1]); rewriter.create<linalg::CopyOp>(loc, linalg_op, args[1]);
rewriter.eraseOp(slice_op); rewriter.eraseOp(slice_op);
} else { } else {
rewriter.replaceOpWithNewOp<SubTensorOp>(slice_op, args[0], offsets, rewriter.replaceOpWithNewOp<tensor::ExtractSliceOp>(
sizes, strides); slice_op, args[0], offsets, sizes, strides);
} }
return success(); return success();
} }
@ -1340,9 +1340,9 @@ class DynamicSliceConverter : public OpConversionPattern<mhlo::DynamicSliceOp> {
this->typeConverter->convertType(dynamic_slice_op.getType()) this->typeConverter->convertType(dynamic_slice_op.getType())
.cast<RankedTensorType>(); .cast<RankedTensorType>();
rewriter.replaceOpWithNewOp<SubTensorOp>(dynamic_slice_op, result_type, rewriter.replaceOpWithNewOp<tensor::ExtractSliceOp>(
adaptor.operand(), start_indices, dynamic_slice_op, result_type, adaptor.operand(), start_indices, sizes,
sizes, strides); strides);
return success(); return success();
} }
}; };
@ -1410,7 +1410,7 @@ class DynamicUpdateSliceConverter
int64_t rank = operand_type.getRank(); int64_t rank = operand_type.getRank();
SmallVector<OpFoldResult, 3> strides(rank, rewriter.getI64IntegerAttr(1)); SmallVector<OpFoldResult, 3> strides(rank, rewriter.getI64IntegerAttr(1));
rewriter.replaceOpWithNewOp<SubTensorInsertOp>( rewriter.replaceOpWithNewOp<tensor::InsertSliceOp>(
op, adaptor.update(), adaptor.operand(), start_indices, sizes, strides); op, adaptor.update(), adaptor.operand(), start_indices, sizes, strides);
return success(); return success();
} }

View File

@ -1762,7 +1762,7 @@ func @slice_whole_stride(%arg0: tensor<3x4xi32>) -> tensor<1x4xi32> {
return %0 : tensor<1x4xi32> return %0 : tensor<1x4xi32>
} }
// CHECK-LABEL: func @slice_whole_stride // CHECK-LABEL: func @slice_whole_stride
// CHECK: subtensor %{{.*}}[1, 0] [1, 4] [1, 1] : tensor<3x4xi32> to tensor<1x4xi32> // CHECK: tensor.extract_slice %{{.*}}[1, 0] [1, 4] [1, 1] : tensor<3x4xi32> to tensor<1x4xi32>
// ----- // -----
@ -1775,7 +1775,7 @@ func @slice_stride_part(%arg0: tensor<3x4xi32>) -> tensor<1x2xi32> {
return %0 : tensor<1x2xi32> return %0 : tensor<1x2xi32>
} }
// CHECK-LABEL: func @slice_stride_part // CHECK-LABEL: func @slice_stride_part
// CHECK: subtensor %{{.*}}[1, 1] [1, 2] [1, 1] : tensor<3x4xi32> to tensor<1x2xi32> // CHECK: tensor.extract_slice %{{.*}}[1, 1] [1, 2] [1, 1] : tensor<3x4xi32> to tensor<1x2xi32>
// ----- // -----
@ -1804,7 +1804,7 @@ func @dynamic_slice(%arg: tensor<3x4xf32>, %start1: tensor<i64>, %start2: tensor
// CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i64 // CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i64
// CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i64 // CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i64
// CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i64 to index // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i64 to index
// CHECK: subtensor %[[ARG0]][%[[START1]], %[[START2]]] [1, 4] [1, 1] // CHECK: tensor.extract_slice %[[ARG0]][%[[START1]], %[[START2]]] [1, 4] [1, 1]
// ----- // -----
@ -1835,7 +1835,7 @@ func @dynamic_slice_unsigned(%arg: tensor<3x4xui32>, %start1: tensor<i64>, %star
// CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i64 // CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i64
// CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i64 // CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i64
// CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i64 to index // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i64 to index
// CHECK: subtensor %[[SIGNLESS_ARG0]][%[[START1]], %[[START2]]] [1, 4] [1, 1] // CHECK: tensor.extract_slice %[[SIGNLESS_ARG0]][%[[START1]], %[[START2]]] [1, 4] [1, 1]
// ----- // -----
@ -1863,7 +1863,7 @@ func @dynamic_update_slice(%target: tensor<3x3xi32>, %update: tensor<2x2xi32>, %
// CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i32 // CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i32
// CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32 // CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32
// CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index
// CHECK: %[[RES:.*]] = subtensor_insert %[[ARG1]] into %[[ARG0]] // CHECK: %[[RES:.*]] = tensor.insert_slice %[[ARG1]] into %[[ARG0]]
// CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1] // CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1]
// CHECK-SAME: : tensor<2x2xi32> into tensor<3x3xi32> // CHECK-SAME: : tensor<2x2xi32> into tensor<3x3xi32>
// CHECK: return %[[RES]] : tensor<3x3xi32> // CHECK: return %[[RES]] : tensor<3x3xi32>
@ -1896,7 +1896,7 @@ func @dynamic_update_slice_unsigned(%target: tensor<3x3xui32>, %update: tensor<2
// CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i32 // CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i32
// CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32 // CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32
// CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index
// CHECK: %[[SIGNLESS_RES:.*]] = subtensor_insert %[[SIGNLESS_UPDATE]] into %[[SIGNLESS_TARGET]] // CHECK: %[[SIGNLESS_RES:.*]] = tensor.insert_slice %[[SIGNLESS_UPDATE]] into %[[SIGNLESS_TARGET]]
// CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1] // CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1]
// CHECK-SAME: : tensor<2x2xi32> into tensor<3x3xi32> // CHECK-SAME: : tensor<2x2xi32> into tensor<3x3xi32>
// CHECK: %[[RES:.*]] = unrealized_conversion_cast %[[SIGNLESS_RES]] : tensor<3x3xi32> to tensor<3x3xui32> // CHECK: %[[RES:.*]] = unrealized_conversion_cast %[[SIGNLESS_RES]] : tensor<3x3xi32> to tensor<3x3xui32>
@ -1930,7 +1930,7 @@ func @dynamic_update_slice_float(%target: tensor<3x3xf32>,
// CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i32 // CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i32
// CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32 // CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32
// CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index
// CHECK: %[[RES:.*]] = subtensor_insert %[[ARG1]] into %[[ARG0]] // CHECK: %[[RES:.*]] = tensor.insert_slice %[[ARG1]] into %[[ARG0]]
// CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1] // CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1]
// CHECK-SAME: : tensor<2x2xf32> into tensor<3x3xf32> // CHECK-SAME: : tensor<2x2xf32> into tensor<3x3xf32>
// CHECK: return %[[RES]] : tensor<3x3xf32> // CHECK: return %[[RES]] : tensor<3x3xf32>