Skip to content

Commit 2aef563

Browse files
authored
Fix SmallVector conversion error with gcc (iree-org#21725)
Fixes the following error I get when compiling with gcc after iree-org#21719: ``` iree/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp: In instantiation of ‘llvm::SmallVector<const T*> mlir::iree_compiler::IREE::Stream::{anonymous}::gatherUsedDialectInterfaces(mlir::ModuleOp) [with T = mlir::iree_compiler::IREE::Stream::AffinityAnalysisDialectInterface]’: iree/compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp:524:54: required from here iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp:61:10: error: could not convert ‘results’ from ‘SmallVector<[...],4>’ to ‘SmallVector<[...],6>’ 61 | return results; | ^~~~~~~ | | | SmallVector<[...],4> ninja: build stopped: subcommand failed. ``` Signed-off-by: Jorn Tuyls <jorn.tuyls@gmail.com>
1 parent 022a3c2 commit 2aef563

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/iree/compiler/Dialect/Stream/Transforms/SpecializeEncodings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SmallVector<const T *> gatherUsedDialectInterfaces(mlir::ModuleOp moduleOp) {
5252

5353
// NOTE: to ensure deterministic output we sort the result so that imports are
5454
// always added in a consistent order.
55-
auto results = llvm::to_vector_of<const T *, 4>(resultSet);
55+
auto results = llvm::to_vector_of<const T *>(resultSet);
5656
llvm::sort(
5757
results, +[](const T *a, const T *b) {
5858
return a->getDialect()->getNamespace().compare(

compiler/src/iree/compiler/Dialect/VM/Transforms/Conversion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ gatherUsedDialectInterfaces(mlir::ModuleOp moduleOp) {
6767

6868
// NOTE: to ensure deterministic output we sort the result so that imports are
6969
// always added in a consistent order.
70-
auto results = llvm::to_vector_of<const T *, 4>(resultSet);
70+
auto results = llvm::to_vector_of<const T *>(resultSet);
7171
llvm::sort(
7272
results, +[](const T *a, const T *b) {
7373
return a->getDialect()->getNamespace().compare(

0 commit comments

Comments
 (0)