Skip to content

Commit bd0fcb2

Browse files
committed
[MLIR][OneShotBufferize] Fix opFilter init
OneShotBufferizePass's opFilter definition in runOnOperation() fails to allow operations for all dialect when the dialectFilter has an empty array value (as opposed to no value). This happens when constructing OneShotBufferizePass from a OneShotBufferizePassOptions parameter with an empty dialectFilter. This commit only does filtering if filterDialect option has a value and it is not an empty array.
1 parent 81ca350 commit bd0fcb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct OneShotBufferizePass
142142
// Configure op filter.
143143
OpFilter::Entry::FilterFn filterFn = [&](Operation *op) {
144144
// Filter may be specified via options.
145-
if (this->dialectFilter.hasValue())
145+
if (this->dialectFilter.hasValue() && !(*this->dialectFilter).empty())
146146
return llvm::is_contained(this->dialectFilter,
147147
op->getDialect()->getNamespace());
148148
// No filter specified: All other ops are allowed.

0 commit comments

Comments
 (0)