diff --git a/WORKSPACE b/WORKSPACE index 3fc3aab..e9b5a5c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,9 +15,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -LLVM_COMMIT = "186f2ac612ad3cd551dee649e3097f4284774ba0" +LLVM_COMMIT = "b3634d3e88b7f26534a5057bff182b7dced584fc" -LLVM_SHA256 = "85807f6c21cc5a79584e0d80d57292e3b001e2c96a784d00a0418918fae616c9" +LLVM_SHA256 = "9e7acffa5eda9597ab3e8f2819a0f3a95d4497fb4672f3441078a5126c408e87" 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 237a03e..60f536a 100644 --- a/build_tools/llvm_version.txt +++ b/build_tools/llvm_version.txt @@ -1,2 +1,2 @@ -186f2ac612ad3cd551dee649e3097f4284774ba0 +b3634d3e88b7f26534a5057bff182b7dced584fc diff --git a/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc b/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc index d17c17f..bf2eca1 100644 --- a/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc +++ b/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc @@ -1270,8 +1270,8 @@ class SliceConverter : public OpConversionPattern { rewriter.create(loc, linalg_op, args[1]); rewriter.eraseOp(slice_op); } else { - rewriter.replaceOpWithNewOp( - slice_op, args[0], offsets, sizes, strides); + rewriter.replaceOpWithNewOp(slice_op, args[0], offsets, + sizes, strides); } return success(); } @@ -1340,9 +1340,9 @@ class DynamicSliceConverter : public OpConversionPattern { this->typeConverter->convertType(dynamic_slice_op.getType()) .cast(); - rewriter.replaceOpWithNewOp( - dynamic_slice_op, result_type, adaptor.operand(), start_indices, sizes, - strides); + rewriter.replaceOpWithNewOp(dynamic_slice_op, result_type, + adaptor.operand(), start_indices, + sizes, strides); return success(); } }; @@ -1410,7 +1410,7 @@ class DynamicUpdateSliceConverter int64_t rank = operand_type.getRank(); SmallVector strides(rank, rewriter.getI64IntegerAttr(1)); - rewriter.replaceOpWithNewOp( + rewriter.replaceOpWithNewOp( op, adaptor.update(), adaptor.operand(), start_indices, sizes, strides); return success(); } diff --git a/tests/hlo-legalize-to-linalg.mlir b/tests/hlo-legalize-to-linalg.mlir index 7e457e4..775fd3a 100644 --- a/tests/hlo-legalize-to-linalg.mlir +++ b/tests/hlo-legalize-to-linalg.mlir @@ -1762,7 +1762,7 @@ func @slice_whole_stride(%arg0: tensor<3x4xi32>) -> tensor<1x4xi32> { return %0 : tensor<1x4xi32> } // CHECK-LABEL: func @slice_whole_stride -// CHECK: tensor.extract_slice %{{.*}}[1, 0] [1, 4] [1, 1] : tensor<3x4xi32> to tensor<1x4xi32> +// CHECK: subtensor %{{.*}}[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> } // CHECK-LABEL: func @slice_stride_part -// CHECK: tensor.extract_slice %{{.*}}[1, 1] [1, 2] [1, 1] : tensor<3x4xi32> to tensor<1x2xi32> +// CHECK: subtensor %{{.*}}[1, 1] [1, 2] [1, 1] : tensor<3x4xi32> to tensor<1x2xi32> // ----- @@ -1804,7 +1804,7 @@ func @dynamic_slice(%arg: tensor<3x4xf32>, %start1: tensor, %start2: tensor // CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i64 // CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i64 // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i64 to index -// CHECK: tensor.extract_slice %[[ARG0]][%[[START1]], %[[START2]]] [1, 4] [1, 1] +// CHECK: subtensor %[[ARG0]][%[[START1]], %[[START2]]] [1, 4] [1, 1] // ----- @@ -1835,7 +1835,7 @@ func @dynamic_slice_unsigned(%arg: tensor<3x4xui32>, %start1: tensor, %star // CHECK: %[[COND4:.*]] = cmpi sgt, %[[T2]], %[[C0]] : i64 // CHECK: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i64 // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i64 to index -// CHECK: tensor.extract_slice %[[SIGNLESS_ARG0]][%[[START1]], %[[START2]]] [1, 4] [1, 1] +// CHECK: subtensor %[[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: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32 // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index -// CHECK: %[[RES:.*]] = tensor.insert_slice %[[ARG1]] into %[[ARG0]] +// CHECK: %[[RES:.*]] = subtensor_insert %[[ARG1]] into %[[ARG0]] // CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1] // CHECK-SAME: : tensor<2x2xi32> into 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: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32 // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index -// CHECK: %[[SIGNLESS_RES:.*]] = tensor.insert_slice %[[SIGNLESS_UPDATE]] into %[[SIGNLESS_TARGET]] +// CHECK: %[[SIGNLESS_RES:.*]] = subtensor_insert %[[SIGNLESS_UPDATE]] into %[[SIGNLESS_TARGET]] // CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1] // CHECK-SAME: : tensor<2x2xi32> into tensor<3x3xi32> // 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: %[[CLAMPED2:.*]] = select %[[COND4]], %[[T2]], %[[C0]] : i32 // CHECK: %[[START2:.*]] = index_cast %[[CLAMPED2]] : i32 to index -// CHECK: %[[RES:.*]] = tensor.insert_slice %[[ARG1]] into %[[ARG0]] +// CHECK: %[[RES:.*]] = subtensor_insert %[[ARG1]] into %[[ARG0]] // CHECK-SAME: [%[[START1]], %[[START2]]] [2, 2] [1, 1] // CHECK-SAME: : tensor<2x2xf32> into tensor<3x3xf32> // CHECK: return %[[RES]] : tensor<3x3xf32>