From 6e9fa418e36eadd7a8859658d88bc57543fc0d34 Mon Sep 17 00:00:00 2001 From: Alan Li Date: Fri, 10 Jan 2025 03:05:01 +0000 Subject: [PATCH] remove deps --- .../Dialect/Encoding/IR/EncodingAttrs.cpp | 7 ++--- .../compiler/Dialect/Stream/IR/BUILD.bazel | 3 +- .../compiler/Dialect/Stream/IR/CMakeLists.txt | 3 +- .../encode_host_tensors_packing_i1_attr.mlir | 29 ------------------- ...tensors_packing_i1_experimental_clopt.mlir | 23 --------------- 5 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_attr.mlir delete mode 100644 compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_experimental_clopt.mlir diff --git a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp index 415eb73c0227..e37589bf96ad 100644 --- a/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp +++ b/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingAttrs.cpp @@ -283,11 +283,8 @@ EncodingAttr getEncodingAttr(RankedTensorType type) { bool hasPackedStorageAttr(Type type) { if (auto tensorType = dyn_cast(type)) { - auto encoding = tensorType.getEncoding(); - if (!encoding) { - return false; - } - return dyn_cast_or_null(encoding) != nullptr; + return dyn_cast_or_null(tensorType.getEncoding()) != + nullptr; } return false; } diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Stream/IR/BUILD.bazel index 68fb04a8f960..ef727de312b6 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/IR/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Stream/IR/BUILD.bazel @@ -64,8 +64,7 @@ iree_compiler_cc_library( ":StreamInterfacesGen", ":StreamOpsGen", ":StreamTypesGen", - "//compiler/src/iree/compiler/Codegen/Common", - "//compiler/src/iree/compiler/Dialect/Util/IR", + "//compiler/src/iree/compiler/Dialect/Encoding/IR", "//compiler/src/iree/compiler/Utils", "@llvm-project//llvm:Support", "@llvm-project//mlir:ArithDialect", diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Stream/IR/CMakeLists.txt index abc1240aaf00..79e4e2c46539 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/IR/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Stream/IR/CMakeLists.txt @@ -54,8 +54,7 @@ iree_cc_library( MLIRTensorDialect MLIRTransformUtils MLIRViewLikeInterface - iree::compiler::Codegen::Common - iree::compiler::Dialect::Util::IR + iree::compiler::Dialect::Encoding::IR iree::compiler::Utils PUBLIC ) diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_attr.mlir b/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_attr.mlir deleted file mode 100644 index f3fa8de8cdb9..000000000000 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_attr.mlir +++ /dev/null @@ -1,29 +0,0 @@ -// RUN: iree-opt --split-input-file --iree-stream-encode-host-tensors %s | FileCheck %s - -#packed = #iree_encoding.packed_storage -func.func @unaligned_i1_size() -> index { - %0 = stream.tensor.sizeof tensor<12xi1, #packed> : index - return %0 : index -} -// CHECK: func @unaligned_i1_size() -> index { -// CHECK-DAG: %[[C2:.+]] = arith.constant 2 : index -// CHECK: return %[[C2]] : index - -// ----- - -#packed = #iree_encoding.packed_storage -func.func @aligned_i1_size() -> index { - %0 = stream.tensor.sizeof tensor<24xi1, #packed> : index - return %0 : index -} - -// CHECK: func @aligned_i1_size() -> index { -// CHECK-DAG: %[[C3:.+]] = arith.constant 3 : index -// CHECK: return %[[C3]] : index - -// ----- - -#packed = #iree_encoding.packed_storage -func.func @packed_i1_input_output(%input : tensor<16xi1, #packed>) -> tensor<16xi1, #packed> { - return %input : tensor<16xi1, #packed> -} diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_experimental_clopt.mlir b/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_experimental_clopt.mlir deleted file mode 100644 index c96e05270d12..000000000000 --- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/test/encode_host_tensors_packing_i1_experimental_clopt.mlir +++ /dev/null @@ -1,23 +0,0 @@ -// This is only used to test the experimental packing flag. When the default -// is changed the encode_host_tensors.mlir test should be updated and used -// instead and this file should be deleted. - -// RUN: iree-opt --split-input-file --iree-stream-encode-host-tensors --iree-experimental-packed-i1-storage %s | FileCheck %s - -// CHECK-LABEL: @tensorSizeOfUnalignedPackedI1 -util.func @tensorSizeOfUnalignedPackedI1() -> index { - // CHECK-DAG: %[[C2:.+]] = arith.constant 2 : index - %0 = stream.tensor.sizeof tensor<12xi1> : index - // CHECK: return %[[C2]] : index - util.return %0 : index -} - -// ----- - -// CHECK-LABEL: @tensorSizeOfAlignedPackedI1 -util.func @tensorSizeOfAlignedPackedI1() -> index { - // CHECK-DAG: %[[C3:.+]] = arith.constant 3 : index - %0 = stream.tensor.sizeof tensor<24xi1> : index - // CHECK: util.return %[[C3]] : index - util.return %0 : index -}