Skip to content

Commit

Permalink
[TOSA] Handle dialect check more efficiently (llvm#120960)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhutton1 authored Dec 30, 2024
1 parent 998bdae commit 39e93ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,13 @@ bool TosaValidation::isValidElementType(Type type) {

void TosaValidation::runOnOperation() {
configLevelAndProfile();

TosaDialect *tosaDialect = getContext().getLoadedDialect<TosaDialect>();
if (!tosaDialect)
return;

getOperation().walk([&](Operation *op) {
if (!op->getDialect() ||
op->getDialect()->getNamespace() != TosaDialect::getDialectNamespace())
if (op->getDialect() != tosaDialect)
return;

for (Value operand : op->getOperands()) {
Expand Down

0 comments on commit 39e93ee

Please sign in to comment.