forked from xdslproject/xdsl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: always print unregistered ops (xdslproject#3303)
`scf.for` prints it's blocks without terminators if there are no `iter_args`. Unfortunately the check for whether an operation is a terminator returns true by default for unregistered operations (presumably so that they don't break verification), and so they don't get printed. This change should make it so that these ops always get printed.
- Loading branch information
1 parent
5666899
commit 82e09ec
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// RUN: xdsl-opt %s --print-op-generic --allow-unregistered-dialect | xdsl-opt --allow-unregistered-dialect | filecheck %s | ||
|
||
// CHECK: func.func @for_unregistered() { | ||
// CHECK-NEXT: %lb = arith.constant 0 : index | ||
// CHECK-NEXT: %ub = arith.constant 42 : index | ||
// CHECK-NEXT: %s = arith.constant 3 : index | ||
// CHECK-NEXT: scf.for %iv = %lb to %ub step %s { | ||
// CHECK-NEXT: "unregistered_op"() : () -> () | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: func.return | ||
// CHECK-NEXT: } | ||
|
||
func.func @for_unregistered() { | ||
%lb = arith.constant 0 : index | ||
%ub = arith.constant 42 : index | ||
%s = arith.constant 3 : index | ||
scf.for %iv = %lb to %ub step %s { | ||
"unregistered_op"() : () -> () | ||
scf.yield | ||
} | ||
func.return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters