Skip to content

Commit 479e9f3

Browse files
committed
[Emit] Avoid reducer crash on unknown dialect ops
Don't assume that an operation has a dialect in the `emit-op-eraser` pattern.
1 parent 9c89d1c commit 479e9f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Dialect/Emit/EmitReductions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct EmitOpEraser : public Reduction {
3232
}
3333

3434
uint64_t match(Operation *op) override {
35-
if (!isa<emit::EmitDialect>(op->getDialect()))
35+
if (!isa_and_nonnull<emit::EmitDialect>(op->getDialect()))
3636
return 0;
3737
if (innerSymUses.hasRef(op))
3838
return 0;

0 commit comments

Comments
 (0)