Skip to content

Commit dc4e900

Browse files
authored
[Util] Update Utils.cpp to address compilation error (iree-org#17593) (iree-org#19908)
iree-org#17593 while reproducing this, I was caught by an error `unpack.mlir` ```mlir func.func @unpack(%arg0: tensor<1x5x2x64xf32>) -> tensor<2x320xf32> { %0 = tensor.empty() : tensor<2x320xf32> %unpack = tensor.unpack %arg0 outer_dims_perm = [0, 1] inner_dims_pos = [0, 1] inner_tiles = [2, 64] into %0 : tensor<1x5x2x64xf32> -> tensor<2x320xf32> return %unpack : tensor<2x320xf32> } ``` exec script: ``` iree-opt --mlir-print-ir-before-all --mlir-pretty-debuginfo \ --pass-pipeline="builtin.module(func.func(iree-codegen-generic-vectorization{enable-vector-masking=true}))" \ --split-input-file unpack.mlir ``` Compilation error workaround
1 parent 13c2964 commit dc4e900

File tree

1 file changed

+3
-0
lines changed
  • compiler/src/iree/compiler/Codegen/Utils

1 file changed

+3
-0
lines changed

compiler/src/iree/compiler/Codegen/Utils/Utils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,9 @@ std::optional<VectorizationTileSizes> inferSizesFromIR(tensor::UnPackOp op) {
17591759
}
17601760

17611761
std::optional<VectorizationTileSizes> inferSizesFromIR(Value val) {
1762+
if (!val.getDefiningOp())
1763+
return std::nullopt;
1764+
17621765
std::optional<VectorizationTileSizes> result;
17631766
TypeSwitch<Operation *, void>(val.getDefiningOp())
17641767
.Case<linalg::LinalgOp>(

0 commit comments

Comments
 (0)