-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: add ability to parse MLIR IR that drops dialect names from oper…
…ations (#1840) Only parsing, no printing. This unlocks us being able to parse MLIR IR directly output from the `mlir-opt` command, without generic syntax or "local scope". I needed this to unlock our experiments for the linalg to frep project, since we use MLIR as the input, and our version of MLIR had different names for some properties, which messed up the generic syntax. I think that the main xdsl project would benefit from these changes also. In my understanding, this is more permissive than MLIR itself, that has specific rules for which ops can drop names and which ones cannot. I'm not sure whether we want to be as strict as them on this.
- Loading branch information
1 parent
add5935
commit bc1b0b0
Showing
6 changed files
with
60 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,13 @@ | ||
// RUN: mlir-opt %s | xdsl-opt | filecheck %s | ||
|
||
module { | ||
func.func public @my_func() { | ||
return | ||
} | ||
} | ||
|
||
// CHECK: builtin.module { | ||
// CHECK-NEXT: func.func public @my_func() { | ||
// CHECK-NEXT: func.return | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } |
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,20 @@ | ||
// RUN: XDSL_ROUNDTRIP | ||
// RUN: XDSL_GENERIC_ROUNDTRIP | ||
|
||
module { | ||
func.func public @my_func() { | ||
return | ||
} | ||
} | ||
|
||
// CHECK: builtin.module { | ||
// CHECK-NEXT: func.func public @my_func() { | ||
// CHECK-NEXT: func.return | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
|
||
// CHECK-GENERIC: "builtin.module"() ({ | ||
// CHECK-GENERIC-NEXT: "func.func"() <{"sym_name" = "my_func", "function_type" = () -> (), "sym_visibility" = "public"}> ({ | ||
// CHECK-GENERIC-NEXT: "func.return"() : () -> () | ||
// CHECK-GENERIC-NEXT: }) : () -> () | ||
// CHECK-GENERIC-NEXT: }) : () -> () |
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
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
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
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